Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 6247988

Browse files
committed
Updated hook
1 parent af42f39 commit 6247988

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

hooks/archive.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,26 @@
2626
from pathspec.gitignore import GitIgnoreSpec
2727
from zipfile import ZipFile, ZIP_DEFLATED
2828

29+
# -----------------------------------------------------------------------------
30+
# State
31+
# -----------------------------------------------------------------------------
32+
33+
# Initialize incremental builds
34+
is_serve = False
35+
2936
# -----------------------------------------------------------------------------
3037
# Hooks
3138
# -----------------------------------------------------------------------------
3239

40+
# Determine whether we're serving the site
41+
def on_startup(command, dirty):
42+
global is_serve
43+
is_serve = command == "serve"
44+
3345
# Create archives for all examples
3446
def on_post_build(config: MkDocsConfig):
47+
if is_serve:
48+
return
3549

3650
# Read files to ignore from .gitignore
3751
with open(".gitignore") as f:

mkdocs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ theme:
4040
- content.action.edit
4141
- content.action.view
4242
- content.tooltips
43-
- navigation.indexes
4443
- navigation.sections
4544
icon:
4645
logo: logo
4746

4847
# Plugins
4948
plugins:
5049
- projects:
51-
cache: false
5250
projects_dir: examples
5351
projects_config_transform: !!python/name:examples.transform
5452

0 commit comments

Comments
 (0)