Skip to content

Commit

Permalink
Updated hook
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Sep 20, 2023
1 parent af42f39 commit 6247988
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 14 additions & 0 deletions hooks/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ theme:
- content.action.edit
- content.action.view
- content.tooltips
- navigation.indexes
- navigation.sections
icon:
logo: logo

# Plugins
plugins:
- projects:
cache: false
projects_dir: examples
projects_config_transform: !!python/name:examples.transform

Expand Down

0 comments on commit 6247988

Please sign in to comment.