-
-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Problem
When using a build cache (e.g., caching the _build folder between CI runs), the theme's static files (quantecon-book-theme.js and quantecon-book-theme.css) are not regenerated even when the theme package is updated.
This causes new theme features (like git metadata headers, collapsible stderr warnings, etc.) to not appear in builds that use a cached _build folder.
Root Cause
The cached _build/html/_static/ folder contains:
scripts/quantecon-book-theme.jsstyles/quantecon-book-theme.css
When Sphinx/Jupyter Book runs with an existing _build folder, it doesn't regenerate these static files if they already exist, even if a newer version of the theme is installed.
Affected Repositories
This affects all lecture repositories that use build caching:
- lecture-jax
- lecture-python.myst
- lecture-python-programming.myst
Possible Solutions
-
Version or hash the static filenames - Include version number or content hash in the filename (e.g.,
quantecon-book-theme-0.13.2.jsorquantecon-book-theme.abc123.js) -
Add cache-busting query parameters - Append version to URL (e.g.,
quantecon-book-theme.js?v=0.13.2) -
Force regeneration in theme - Have the theme check its version against cached files and regenerate if needed
Current Workaround
Rebuild the cache from scratch after theme updates, or manually delete the cached theme static files before building.