Skip to content

Commit

Permalink
fix: plugin instance lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkrzyskow committed Oct 13, 2024
1 parent bdfb2d5 commit 23110c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions mkdocs_nype/plugins/server_redirects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def on_config(self, config: MkDocsConfig) -> MkDocsConfig | None:

# Find redirects plugin
for name, instance in config.plugins.items():
if name.split()[0].endswith("redirects"):
if name.split()[0].split("/")[-1] == "redirects":
self.redirects_plugin = instance
break

# Check if there is anything to process
redirect_maps = None
redirect_maps = {}
if self.redirects_plugin:
redirect_maps = self.redirects_plugin.config.get("redirect_maps")

Expand All @@ -48,6 +48,7 @@ def on_env(
if self.config.raw_redirects:
self.output_redirects.update(self.config.raw_redirects)

redirect_maps = {}
if self.redirects_plugin:
redirect_maps = self.redirects_plugin.config.get("redirect_maps") or {}

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "hatchling.build"

[project]
name = "mkdocs-nype"
version = "0.18.0"
version = "0.18.1"
description = "MkDocs theme for Nype MkDocs projects, extends the Material for MkDocs theme"
authors = [
{ name = "Kamil Krzyśków", email = "[email protected]" }
Expand Down

0 comments on commit 23110c0

Please sign in to comment.