[docs] move site gen to a post-push hook

This commit is contained in:
Jan Petykiewicz 2026-04-19 00:09:33 -07:00
commit 9453e9203a
4 changed files with 81 additions and 61 deletions

View file

@ -126,9 +126,25 @@ When hosted on a Forgejo instance, the intended setup is:
- serve that branch from the instance's static-pages host
- point the repository's **Wiki** tab at the published docs URL
The repository contains a Forgejo Actions workflow for publishing the docs
branch automatically. Set the repository variable `DOCS_SITE_URL` to the final
published URL so MkDocs can generate canonical links correctly.
This repository now uses a version-controlled `post-push` hook rather than a
Forgejo runner. The hook watches for successful pushes of `master` to `origin`,
builds the docs locally, and force-updates the `docs-site` branch from the same
machine.
Enable the tracked hooks with:
```bash
./scripts/enable_git_hooks.sh
```
To also persist the published docs URL for canonical MkDocs links, pass it to
the setup script:
```bash
./scripts/enable_git_hooks.sh 'https://docs.example.com/meanas/'
```
The hook will also respect a shell-level `DOCS_SITE_URL` override if one is set.
Install the docs toolchain with:
@ -148,7 +164,7 @@ This produces:
- a combined printable single-page HTML site under `site/print_page/`
- an optional fully inlined `site/standalone.html` when `htmlark` is available
The same build output is what the Forgejo Actions workflow publishes to the
The version-controlled `post-push` hook publishes this same output to the
`docs-site` branch.
The docs build uses a local MathJax bundle vendored under `docs/assets/`, so