Documentation
¶
Overview ¶
Command pagespublish puts one documentation build into a checkout of a gh-pages branch, the way mike did it, so that every published version keeps its own path.
pagespublish <version> <built site> <gh-pages checkout>
<version> is MAJOR.MINOR (0.16) or "main" while no release is tagged. The build replaces <pages>/<version>/ and nothing else; then, from the directories present:
versions.json mike's format ({version, title, aliases}), newest release
first and "main" last, which is what the Hextra fork's
version selector reads
latest a link to the newest release, or to main when none
index.html the root, redirecting to latest/, as mike wrote it
⛔ IT EXISTS BECAUSE A HAND-WRITTEN PUBLISH STEP GOT THE PATH WRONG, in 76 repositories at once. The workflow mkdocs2hextra generated copied the built site to `docs/<version>/` inside gh-pages — but a project repository called `docs` is already served at `/docs/`, so the site landed at `/docs/docs/main/` while `/docs/latest/` went on serving the MkDocs build mike had left there. Both URLs answered 200, which is why no check caught it: the site was published, just not where anything links.
⛔ AND IT IS GO RATHER THAN THE SHELL SCRIPT IT REPLACES. The fleet's reference site carries a 60-line scripts/publish-version.sh; copying that into 76 repositories would be 76 copies of untested shell, and the house rule is Go. One command, one test suite, called in one line from every workflow.