Skip to content

Commit d7ffa27

Browse files
committed
Merge branch 'master' into merge/piri-piri
2 parents c995078 + 39580db commit d7ffa27

File tree

5 files changed

+18
-25
lines changed

5 files changed

+18
-25
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
mkdocs-material-9.1.20 (2023-07-27)
2+
3+
* Fixed deprecation warnings for social plugin
4+
15
mkdocs-material-9.1.19 (2023-07-18)
26

37
* Added support for MkDocs 1.5+

docs/changelog/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
- Updated MkDocs to 1.5.0
2626
- Fixed rendering of tags when announcement bar is present
2727

28+
### 9.1.20 <small>July 27, 2023</small> { id="9.1.20" }
29+
30+
- Updated Sanskrit translations
31+
- Fixed deprecation warnings for social plugin
32+
2833
### 9.1.19 <small>July 18, 2023</small> { id="9.1.19" }
2934

3035
- Added support for MkDocs 1.5+

docs/guides/creating-a-reproduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ inside it. Next:
9393
non-essential lines and files.
9494
9595
[bug reporting guide]: ../contributing/reporting-a-bug.md#upgrade-to-latest-version
96-
[minimal configuration]: ../../creating-your-site/#minimal-configuration
96+
[minimal configuration]: ../creating-your-site.md#minimal-configuration
9797
9898
### Creating a .zip file
9999

material/plugins/social/plugin.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class SocialPlugin(BasePlugin[SocialConfig]):
4848

4949
def __init__(self):
5050
self._executor = concurrent.futures.ThreadPoolExecutor(4)
51-
self.custom_dir = None
5251

5352
# Retrieve configuration
5453
def on_config(self, config):
@@ -107,13 +106,6 @@ def on_config(self, config):
107106
"text": options.get("color", self.color["text"])
108107
}
109108

110-
# Retrieve custom_dir path
111-
for user_config in config.user_configs:
112-
custom_dir = user_config.get("theme", {}).get("custom_dir")
113-
if custom_dir:
114-
self.custom_dir = custom_dir
115-
break
116-
117109
# Retrieve logo and font
118110
self._resized_logo_promise = self._executor.submit(self._load_resized_logo, config)
119111
self.font = self._load_font(config)
@@ -365,8 +357,8 @@ def _load_logo(self, config):
365357
path = os.path.join(config.docs_dir, theme["logo"])
366358

367359
# Allow users to put the logo inside their custom_dir (theme["logo"] case)
368-
if self.custom_dir:
369-
custom_dir_logo = os.path.join(self.custom_dir, theme["logo"])
360+
if theme.custom_dir:
361+
custom_dir_logo = os.path.join(theme.custom_dir, theme["logo"])
370362
if os.path.exists(custom_dir_logo):
371363
path = custom_dir_logo
372364

@@ -393,8 +385,8 @@ def _load_logo(self, config):
393385
path = f"{base}/.icons/{logo}.svg"
394386

395387
# Allow users to put the logo inside their custom_dir (theme["icon"]["logo"] case)
396-
if self.custom_dir:
397-
custom_dir_logo = os.path.join(self.custom_dir, ".icons", f"{logo}.svg")
388+
if theme.custom_dir:
389+
custom_dir_logo = os.path.join(theme.custom_dir, ".icons", f"{logo}.svg")
398390
if os.path.exists(custom_dir_logo):
399391
path = custom_dir_logo
400392

src/plugins/social/plugin.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class SocialPlugin(BasePlugin[SocialConfig]):
4848

4949
def __init__(self):
5050
self._executor = concurrent.futures.ThreadPoolExecutor(4)
51-
self.custom_dir = None
5251

5352
# Retrieve configuration
5453
def on_config(self, config):
@@ -107,13 +106,6 @@ def on_config(self, config):
107106
"text": options.get("color", self.color["text"])
108107
}
109108

110-
# Retrieve custom_dir path
111-
for user_config in config.user_configs:
112-
custom_dir = user_config.get("theme", {}).get("custom_dir")
113-
if custom_dir:
114-
self.custom_dir = custom_dir
115-
break
116-
117109
# Retrieve logo and font
118110
self._resized_logo_promise = self._executor.submit(self._load_resized_logo, config)
119111
self.font = self._load_font(config)
@@ -365,8 +357,8 @@ def _load_logo(self, config):
365357
path = os.path.join(config.docs_dir, theme["logo"])
366358

367359
# Allow users to put the logo inside their custom_dir (theme["logo"] case)
368-
if self.custom_dir:
369-
custom_dir_logo = os.path.join(self.custom_dir, theme["logo"])
360+
if theme.custom_dir:
361+
custom_dir_logo = os.path.join(theme.custom_dir, theme["logo"])
370362
if os.path.exists(custom_dir_logo):
371363
path = custom_dir_logo
372364

@@ -393,8 +385,8 @@ def _load_logo(self, config):
393385
path = f"{base}/.icons/{logo}.svg"
394386

395387
# Allow users to put the logo inside their custom_dir (theme["icon"]["logo"] case)
396-
if self.custom_dir:
397-
custom_dir_logo = os.path.join(self.custom_dir, ".icons", f"{logo}.svg")
388+
if theme.custom_dir:
389+
custom_dir_logo = os.path.join(theme.custom_dir, ".icons", f"{logo}.svg")
398390
if os.path.exists(custom_dir_logo):
399391
path = custom_dir_logo
400392

0 commit comments

Comments
 (0)