diff --git a/hooks/archive.py b/hooks/archive.py index 39346a4..8cea943 100644 --- a/hooks/archive.py +++ b/hooks/archive.py @@ -26,12 +26,26 @@ from pathspec.gitignore import GitIgnoreSpec from zipfile import ZipFile, ZIP_DEFLATED +# ----------------------------------------------------------------------------- +# State +# ----------------------------------------------------------------------------- + +# Initialize incremental builds +is_serve = False + # ----------------------------------------------------------------------------- # Hooks # ----------------------------------------------------------------------------- +# Determine whether we're serving the site +def on_startup(command, dirty): + global is_serve + is_serve = command == "serve" + # Create archives for all examples def on_post_build(config: MkDocsConfig): + if is_serve: + return # Read files to ignore from .gitignore with open(".gitignore") as f: diff --git a/mkdocs.yml b/mkdocs.yml index 79875ca..8cfc831 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,7 +40,6 @@ theme: - content.action.edit - content.action.view - content.tooltips - - navigation.indexes - navigation.sections icon: logo: logo @@ -48,7 +47,6 @@ theme: # Plugins plugins: - projects: - cache: false projects_dir: examples projects_config_transform: !!python/name:examples.transform