Skip to content

Commit

Permalink
Run post-build after all other plugins (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed Apr 27, 2023
1 parent 69172f2 commit 10034c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mkdocs_gen_files/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
from .config_items import ListOfFiles
from .editor import FilesEditor

try:
from mkdocs.plugins import event_priority
except ImportError:
event_priority = lambda priority: lambda f: f # No-op fallback

log = logging.getLogger(f"mkdocs.plugins.{__name__}")


Expand Down Expand Up @@ -57,6 +62,7 @@ def on_page_content(self, html, page: Page, config: Config, files: Files):

return html

@event_priority(-100)
def on_post_build(self, config: Config):
self._dir.cleanup()

Expand Down

0 comments on commit 10034c5

Please sign in to comment.