From 768125ce7faf463fcc229e1edeaa772b264fa761 Mon Sep 17 00:00:00 2001 From: Alex Voss Date: Wed, 25 Oct 2023 10:39:09 +0100 Subject: [PATCH 1/3] Get right of MkDocs Theme ._vars deprecation warning --- mkdocs_rss_plugin/util.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mkdocs_rss_plugin/util.py b/mkdocs_rss_plugin/util.py index f67d3806..d0deb672 100644 --- a/mkdocs_rss_plugin/util.py +++ b/mkdocs_rss_plugin/util.py @@ -620,13 +620,14 @@ def guess_locale(mkdocs_config: Config) -> str or None: return mkdocs_config.get("locale") # Some themes implement a locale or a language setting - if "theme" in mkdocs_config and "locale" in mkdocs_config.get("theme"): - locale = mkdocs_config.get("theme")._vars.get("locale") - return f"{locale.language}-{locale.territory}" - elif "theme" in mkdocs_config and "language" in mkdocs_config.get("theme"): - return mkdocs_config.get("theme")._vars.get("language") - else: - return None + if "theme" in mkdocs_config: + theme = mkdocs_config["theme"] + if "locale" in theme: + locale = theme["locale"] + return f"{locale.language}-{locale.territory}" + elif "language" in theme: + return theme["language"] + return None @staticmethod def filter_pages(pages: list, attribute: str, length: int) -> list: From ade0027636a1123e06040707744bc7188f0e3da4 Mon Sep 17 00:00:00 2001 From: Alex Voss Date: Wed, 25 Oct 2023 11:25:55 +0100 Subject: [PATCH 2/3] added a watch for README.md --- mkdocs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mkdocs.yml b/mkdocs.yml index 848ea8c3..e582ca67 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,6 +34,9 @@ plugins: utm_campaign: "feed-syndication" - search +watch: + - README.md + theme: name: united language: en From d8d896a7a193609d9a90b5a5a244b91ded8d66c4 Mon Sep 17 00:00:00 2001 From: Alex Voss Date: Wed, 25 Oct 2023 11:31:48 +0100 Subject: [PATCH 3/3] +link to fork for PRs, fixed link broken in website version --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eaf23c3f..f2f40c8a 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,9 @@ Following initiative from the author of Material for MkDocs, this plugin provide ## Development -Clone the repository: +Clone the repository. If you are not a collaborator then first [fork it +on GitHub](https://github.com/Guts/mkdocs-rss-plugin/fork) and clone +your fork. Change into the directory that contains the code, then: ```bash # install development dependencies @@ -86,7 +88,7 @@ python -m pip install -U -r requirements/documentation.txt # alternatively: pip install -e .[doc] ``` -Then follow the [contribution guidelines](CONTRIBUTING.md). +Then follow the [contribution guidelines](https://github.com/Guts/mkdocs-rss-plugin/blob/main/CONTRIBUTING.md) ## Release workflow