mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed social plugin crashing for Inter font
This commit is contained in:
parent
db8d13debd
commit
cb485499eb
@ -28,6 +28,7 @@ import requests
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from glob import glob
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from mkdocs.commands.build import DuplicateFilter
|
from mkdocs.commands.build import DuplicateFilter
|
||||||
@ -393,7 +394,8 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]):
|
|||||||
name = "Roboto"
|
name = "Roboto"
|
||||||
|
|
||||||
# Retrieve font files, if not already done
|
# Retrieve font files, if not already done
|
||||||
files = os.listdir(self.cache)
|
files = glob(f"{self.cache}/**/*.[ot]tf")
|
||||||
|
files = [os.path.relpath(file, self.cache) for file in files]
|
||||||
files = [file for file in files if file.endswith(".ttf") or file.endswith(".otf")] or (
|
files = [file for file in files if file.endswith(".ttf") or file.endswith(".otf")] or (
|
||||||
self._load_font_from_google(name)
|
self._load_font_from_google(name)
|
||||||
)
|
)
|
||||||
|
@ -28,6 +28,7 @@ import requests
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from glob import glob
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from mkdocs.commands.build import DuplicateFilter
|
from mkdocs.commands.build import DuplicateFilter
|
||||||
@ -393,7 +394,8 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]):
|
|||||||
name = "Roboto"
|
name = "Roboto"
|
||||||
|
|
||||||
# Retrieve font files, if not already done
|
# Retrieve font files, if not already done
|
||||||
files = os.listdir(self.cache)
|
files = glob(f"{self.cache}/**/*.[ot]tf")
|
||||||
|
files = [os.path.relpath(file, self.cache) for file in files]
|
||||||
files = [file for file in files if file.endswith(".ttf") or file.endswith(".otf")] or (
|
files = [file for file in files if file.endswith(".ttf") or file.endswith(".otf")] or (
|
||||||
self._load_font_from_google(name)
|
self._load_font_from_google(name)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user