From f548d799911fc63699d665c70f76f0c1479ed97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Krzy=C5=9Bk=C3=B3w?= Date: Tue, 25 Jul 2023 19:25:45 +0100 Subject: [PATCH 1/4] Updated social plugin to use `theme.custom_dir` --- material/plugins/social/plugin.py | 16 ++++------------ src/plugins/social/plugin.py | 16 ++++------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/material/plugins/social/plugin.py b/material/plugins/social/plugin.py index de16f6098..4c203e2a1 100644 --- a/material/plugins/social/plugin.py +++ b/material/plugins/social/plugin.py @@ -78,7 +78,6 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]): def __init__(self): self._executor = concurrent.futures.ThreadPoolExecutor(4) - self.custom_dir = None # Retrieve configuration def on_config(self, config): @@ -145,13 +144,6 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]): "text": options.get("color", self.color["text"]) } - # Retrieve custom_dir path - for user_config in config.user_configs: - custom_dir = user_config.get("theme", {}).get("custom_dir") - if custom_dir: - self.custom_dir = custom_dir - break - # Retrieve logo and font self._resized_logo_promise = self._executor.submit(self._load_resized_logo, config) self.font = self._load_font(config) @@ -403,8 +395,8 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]): path = os.path.join(config.docs_dir, theme["logo"]) # Allow users to put the logo inside their custom_dir (theme["logo"] case) - if self.custom_dir: - custom_dir_logo = os.path.join(self.custom_dir, theme["logo"]) + if theme.custom_dir: + custom_dir_logo = os.path.join(theme.custom_dir, theme["logo"]) if os.path.exists(custom_dir_logo): path = custom_dir_logo @@ -431,8 +423,8 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]): path = f"{base}/.icons/{logo}.svg" # Allow users to put the logo inside their custom_dir (theme["icon"]["logo"] case) - if self.custom_dir: - custom_dir_logo = os.path.join(self.custom_dir, ".icons", f"{logo}.svg") + if theme.custom_dir: + custom_dir_logo = os.path.join(theme.custom_dir, ".icons", f"{logo}.svg") if os.path.exists(custom_dir_logo): path = custom_dir_logo diff --git a/src/plugins/social/plugin.py b/src/plugins/social/plugin.py index de16f6098..4c203e2a1 100644 --- a/src/plugins/social/plugin.py +++ b/src/plugins/social/plugin.py @@ -78,7 +78,6 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]): def __init__(self): self._executor = concurrent.futures.ThreadPoolExecutor(4) - self.custom_dir = None # Retrieve configuration def on_config(self, config): @@ -145,13 +144,6 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]): "text": options.get("color", self.color["text"]) } - # Retrieve custom_dir path - for user_config in config.user_configs: - custom_dir = user_config.get("theme", {}).get("custom_dir") - if custom_dir: - self.custom_dir = custom_dir - break - # Retrieve logo and font self._resized_logo_promise = self._executor.submit(self._load_resized_logo, config) self.font = self._load_font(config) @@ -403,8 +395,8 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]): path = os.path.join(config.docs_dir, theme["logo"]) # Allow users to put the logo inside their custom_dir (theme["logo"] case) - if self.custom_dir: - custom_dir_logo = os.path.join(self.custom_dir, theme["logo"]) + if theme.custom_dir: + custom_dir_logo = os.path.join(theme.custom_dir, theme["logo"]) if os.path.exists(custom_dir_logo): path = custom_dir_logo @@ -431,8 +423,8 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]): path = f"{base}/.icons/{logo}.svg" # Allow users to put the logo inside their custom_dir (theme["icon"]["logo"] case) - if self.custom_dir: - custom_dir_logo = os.path.join(self.custom_dir, ".icons", f"{logo}.svg") + if theme.custom_dir: + custom_dir_logo = os.path.join(theme.custom_dir, ".icons", f"{logo}.svg") if os.path.exists(custom_dir_logo): path = custom_dir_logo From 068472a6f7a78d7643aedff90884da1df3300082 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Thu, 27 Jul 2023 09:43:26 +0200 Subject: [PATCH 2/4] Documentation --- docs/guides/creating-a-reproduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/creating-a-reproduction.md b/docs/guides/creating-a-reproduction.md index 7aa43d7bd..cb4cb07b9 100644 --- a/docs/guides/creating-a-reproduction.md +++ b/docs/guides/creating-a-reproduction.md @@ -93,7 +93,7 @@ inside it. Next: non-essential lines and files. [bug reporting guide]: ../contributing/reporting-a-bug.md#upgrade-to-latest-version - [minimal configuration]: ../../creating-your-site/#minimal-configuration + [minimal configuration]: ../creating-your-site.md#minimal-configuration ### Creating a .zip file From 08ab76fd0596c68bdc6ea0c7f0c1f8124435b40b Mon Sep 17 00:00:00 2001 From: squidfunk Date: Thu, 27 Jul 2023 09:46:49 +0200 Subject: [PATCH 3/4] Prepare 9.1.20 release --- CHANGELOG | 4 ++++ docs/changelog/index.md | 4 ++++ material/base.html | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 890f6e88c..0bc67563e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +mkdocs-material-9.1.20 (2023-07-27) + + * Fixed deprecation warnings for social plugin + mkdocs-material-9.1.19 (2023-07-18) * Added support for MkDocs 1.5+ diff --git a/docs/changelog/index.md b/docs/changelog/index.md index 540d2c9cb..03067af73 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -2,6 +2,10 @@ ## Material for MkDocs +### 9.1.20 July 27, 2023 { id="9.1.20" } + +- Fixed deprecation warnings for social plugin + ### 9.1.19 July 18, 2023 { id="9.1.19" } - Added support for MkDocs 1.5+ diff --git a/material/base.html b/material/base.html index b228bf446..2b1eacb54 100644 --- a/material/base.html +++ b/material/base.html @@ -28,7 +28,7 @@ {% endif %} - + {% endblock %} {% block htmltitle %} {% if page.meta and page.meta.title %} diff --git a/package-lock.json b/package-lock.json index 64dd3dbbd..248dcc56c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mkdocs-material", - "version": "9.1.19", + "version": "9.1.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mkdocs-material", - "version": "9.1.19", + "version": "9.1.20", "license": "MIT", "dependencies": { "array-flat-polyfill": "^1.0.1", diff --git a/package.json b/package.json index 94a87ef87..365adba2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mkdocs-material", - "version": "9.1.19", + "version": "9.1.20", "description": "Documentation that simply works", "keywords": [ "mkdocs", From 39580db0ac6d7006498c8c253d8e54b0354d23e4 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Thu, 27 Jul 2023 09:49:09 +0200 Subject: [PATCH 4/4] Updated changelog --- docs/changelog/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog/index.md b/docs/changelog/index.md index 03067af73..1f29e8a5a 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -4,6 +4,7 @@ ### 9.1.20 July 27, 2023 { id="9.1.20" } +- Updated Sanskrit translations - Fixed deprecation warnings for social plugin ### 9.1.19 July 18, 2023 { id="9.1.19" }