From d0cb088b56ead6c3ea5c13349ceb8b4f660ac3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Krzy=C5=9Bk=C3=B3w?= Date: Sat, 9 Nov 2024 20:25:13 +0100 Subject: [PATCH] fix: add event priority to keep order intact --- mkdocs_nype/extensions/material.py | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mkdocs_nype/extensions/material.py b/mkdocs_nype/extensions/material.py index 50d35de..d4c0e07 100644 --- a/mkdocs_nype/extensions/material.py +++ b/mkdocs_nype/extensions/material.py @@ -21,6 +21,7 @@ from mkdocs.config.base import Config from mkdocs.config.config_options import Choice, Deprecated, DictOfItems, Optional, Type from mkdocs.exceptions import PluginError +from mkdocs.plugins import event_priority def extend_blog(): @@ -63,6 +64,7 @@ def extended(self, config): def wrap_blog_on_files(func): + @event_priority(-50) def extended(self, files, *, config): result = func(self, files, config=config) @@ -85,6 +87,7 @@ def extended(self, files, *, config): def wrap_blog_on_page_markdown(func): + @event_priority(-50) def extended(self, markdown: str, /, *, page, config, files): view = self._resolve_original(page) @@ -123,6 +126,7 @@ def extended(self, markdown: str, /, *, page, config, files): def wrap_blog_on_page_context(func): + @event_priority(-100) def extended(self, context, *, page, config, nav): view = self._resolve_original(page) diff --git a/pyproject.toml b/pyproject.toml index b31a169..9937a79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "hatchling.build" [project] name = "mkdocs-nype" -version = "0.22.0" +version = "0.22.1" description = "MkDocs theme for Nype MkDocs projects, extends the Material for MkDocs theme" authors = [ { name = "Kamil Krzyśków", email = "kk@npe.cm" }