Docs Versioning
The documentation site can serve multiple versions of the docs at once. The version selector in the sidebar switches between them, and each version has its own URL prefix, navigation, API reference, and search index.
How it works
Section titled “How it works”Versioning uses isolated per-version Astro builds assembled into one deploy. There is no third-party versioning plugin — the mechanism is a small manifest plus a build orchestrator.
-
versions.json(indocs/site/) is the single source of truth. Each entry:Field Meaning idStable identifier, also the URL segment (e.g. 2.0,next).labelText shown in the version selector. baseURL base: /for the default,/<id>/for the rest.refGit ref used for that version’s “Edit page” links. defaultExactly one entry is true; it is served at the site root.developmentOptional; shows an “in-development” banner for that version. -
scripts/build-versions.mjsruns oneastro buildper entry withDOCS_VERSION=<id>set.astro.config.mjsreadsDOCS_VERSIONand sets the Astrobase, output directory, and edit-link ref, registers the per-versionSidebarandBannercomponent overrides, and marksdevelopmentversionsnoindex. -
Each build produces its own pages, its own Pagefind search index, and its own OpenAPI reference under its base. The orchestrator then assembles them: the default version at
dist/, every other version underdist/<id>/. A guard verifies the assembled output before it is deployed. -
Deployment is unchanged: Cloudflare Workers serve the whole
docs/site/disttree, so the default version answers athttps://docs.praxrr.dev/and, for example, thenextversion athttps://docs.praxrr.dev/next/.
The version selector navigates to the root of the chosen version (not the equivalent sub-page), because content maps differ across versions.
Pre-v2 note
Section titled “Pre-v2 note”Until Praxrr v2 is released there is only one line of documentation, so every configured version currently renders the same content — they are distinguished only by URL base, selector label, and the development banner. This stands up the versioning mechanism now; real divergence begins when a stable version is frozen (below).
Publish a new version
Section titled “Publish a new version”- Freeze the outgoing stable content so it stops tracking ongoing edits — either tag
its git ref (e.g.
docs-v2.0) or snapshotsrc/content/docs/**into a committedversions/<id>/directory, and point that version’s build at the frozen source. - Edit
versions.json: add the new stable entry withbase: "/"anddefault: true; move the previous version tobase: "/<id>/"and drop itsdefault. - Build: run
npm run buildindocs/site/. The orchestrator builds every entry and the guard checks the assembleddist/. - Open a PR. CI rebuilds and runs the same guard; merging to
maindeploys the combined site to Cloudflare Workers.
Only build versions where the praxrr-schema / praxrr-db mirrors are checked out, so
the sync:external-docs step never freezes fallback stub content into a version.