Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #207

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ plugins:
utm_campaign: "feed-syndication"
- search

watch:
- README.md

theme:
name: united
language: en
Expand Down
15 changes: 8 additions & 7 deletions mkdocs_rss_plugin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down