From 3a7240b5c8aa7bf1138b12a6a29b477105362194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Fri, 4 Sep 2026 09:49:37 +0200 Subject: [PATCH 1/2] website: upgrade zensical to v0.0.59 --- website/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/requirements.txt b/website/requirements.txt index ab6617313..2446fb53d 100644 --- a/website/requirements.txt +++ b/website/requirements.txt @@ -1 +1 @@ -zensical==0.0.56 +zensical==0.0.59 From 1b9442aef5a3e59ada5ef2b73c346a0362f83600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Fri, 4 Sep 2026 09:50:45 +0200 Subject: [PATCH 2/2] website: restore native redirects and minify plugins zensical v0.0.58 added MkDocs-compatible replacements for the redirects and minify plugins that were dropped when we migrated away from mkdocs-material (mkdocs-redirects, mkdocs-minify-plugin), since mkdocs v1 plugins can't run under zensical. Restore the original plugin configuration in mkdocs.yml (same redirect_maps and minify options as before the migration), and drop the corresponding hand-rolled redirect-generation logic from post-build.sh now that it is redundant. post-build.sh now only generates the Plausible analytics proxy endpoint, since zensical still has no equivalent for arbitrary MkDocs hooks. --- .github/workflows/website.yaml | 2 +- website/mkdocs.yml | 17 +++++++++ website/post-build.sh | 63 ++++------------------------------ 3 files changed, 24 insertions(+), 58 deletions(-) diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 3e858cdbb..280e1b40b 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -27,7 +27,7 @@ jobs: - name: Build the site run: zensical build --strict --config-file website/mkdocs.yml - - name: Post-build (redirects and analytics) + - name: Post-build (analytics) run: bash website/post-build.sh website/rendered - name: Publish to Cloudflare Pages diff --git a/website/mkdocs.yml b/website/mkdocs.yml index 10b683586..8dedcb5c7 100644 --- a/website/mkdocs.yml +++ b/website/mkdocs.yml @@ -75,6 +75,23 @@ theme: name: Switch to light mode plugins: - search: + - minify: + minify_html: true + minify_js: true + minify_css: true + htmlmin_opts: + remove_comments: true + cache_safe: true + - redirects: + redirect_maps: + 'getting_started.md': 'getting-started.md' + 'development/index.md': 'development/contributing.md' + 'development/controller-design.md': 'development/controller-implementation.md' + 'development/design-decisions.md': 'concepts/design-principles.md' + 'development/coding-convention.md': 'development/coding-standards.md' + 'development/api-contracts.md': 'development/api-design.md' + 'user-guide/index.md': 'concepts/core-concepts.md' + 'user-guide/drift-detection.md': 'concepts/drift-detection.md' markdown_extensions: - admonition - attr_list diff --git a/website/post-build.sh b/website/post-build.sh index 7073246b2..462ab14eb 100644 --- a/website/post-build.sh +++ b/website/post-build.sh @@ -1,67 +1,16 @@ #!/bin/bash # Post-build script for zensical/mkdocs site. -# Generates redirect pages and analytics proxy endpoint. +# Generates the analytics proxy endpoint. +# +# Redirects and HTML/asset minification are now handled natively by +# zensical's built-in `redirects` and `minify` plugin replacements +# (see mkdocs.yml), so this script only needs to cover what zensical +# doesn't support yet: arbitrary MkDocs `hooks`. set -euo pipefail SITE_DIR="${1:?Usage: $0 }" -# --- Redirects --- -# Replaces mkdocs-redirects plugin. Each entry maps an old path (directory URL) -# to a new relative URL. -declare -A REDIRECTS=( - ["getting_started"]="../getting-started/" - ["development/controller-design"]="../controller-implementation/" - ["development/design-decisions"]="../../concepts/design-principles/" - ["development/coding-convention"]="../coding-standards/" - ["development/api-contracts"]="../api-design/" - ["user-guide/drift-detection"]="../../concepts/drift-detection/" -) - -# index.md redirects are special: they build to /index.html directly -declare -A INDEX_REDIRECTS=( - ["development"]="contributing/" - ["user-guide"]="../concepts/core-concepts/" -) - -for src in "${!REDIRECTS[@]}"; do - dest="${REDIRECTS[$src]}" - dir="$SITE_DIR/$src" - mkdir -p "$dir" - cat > "$dir/index.html" < - - - - - - - -

This page has moved. If you are not redirected, click here.

- - -EOF -done - -for src in "${!INDEX_REDIRECTS[@]}"; do - dest="${INDEX_REDIRECTS[$src]}" - dir="$SITE_DIR/$src" - mkdir -p "$dir" - cat > "$dir/index.html" < - - - - - - - -

This page has moved. If you are not redirected, click here.

- - -EOF -done - # --- Analytics proxy endpoint --- # Replaces hooks.py on_post_build. Creates an empty script for the Plausible # analytics reverse-proxy setup.