Skip to content

Commit 95fb5fd

Browse files
authored
Update plugin.py
fix 'DeprecationWarning: Do not access Theme._vars, instead access the keys of Theme directly.'
1 parent 407346e commit 95fb5fd

File tree

1 file changed

+1
-1
lines changed
  • src/mkdocs_git_revision_date_localized_plugin

1 file changed

+1
-1
lines changed

src/mkdocs_git_revision_date_localized_plugin/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def on_config(self, config: config_options.Config, **kwargs) -> Dict[str, Any]:
7878
# theme locale
7979
if "theme" in config and "language" in config.get("theme"):
8080
custom_theme = config.get("theme")
81-
theme_locale = custom_theme._vars.get("language")
81+
theme_locale = custom_theme["language"] if Version(mkdocs_version) >= Version("1.6.0") else custom_theme._vars.get("language")
8282
logging.debug(
8383
"Locale '%s' extracted from the custom theme: '%s'"
8484
% (theme_locale, custom_theme.name)

0 commit comments

Comments
 (0)