Skip to content

build(versioning): wire Docusaurus versioning, short of the first snapshot - #108

Merged
JosteinGj merged 1 commit into
masterfrom
docs/docusaurus-versioning
Oct 1, 2026
Merged

JosteinGj merged 1 commit into
masterfrom
docs/docusaurus-versioning

Conversation

@JosteinGj

Copy link
Copy Markdown
Contributor

Sets up Docusaurus versioning without cutting a snapshot, so the first release
is one command away and nothing unreleased is published in the meantime.

The published site is unchanged. No /next/, no version routes, one search
index, v1.0 badge still in the navbar. Final build: exit 0, zero warnings.

docusaurus.config.js

  • editCurrentVersion: true — once a snapshot exists, its "Edit this page" points
    at docs/ instead of into the frozen copy, which the stock link would do and
    which AGENTS.md forbids (a snapshot takes corrections for its own release; a new
    feature goes to docs/). No effect until then; the current edit links still
    resolve to docs/<page>.
  • The v1.0 badge stays, with a comment on when to swap it for the dropdown. With
    zero snapshots docsVersionDropdown renders as a lone navbar link labelled after
    the development version — tested — which reads as a release claim.
  • A comment recording why lastVersion is deliberately absent.

AGENTS.md

The five snapshot steps now match how the plugin actually behaves:

  • Step 1 — cut from an up-to-date master, as the last step before the PR. Any
    merge into docs/ makes an uncut snapshot stale, and there is no refresh command,
    only delete and cut again.
  • Step 2 — do not set lastVersion. It defaults to the newest name in
    versions.json (plugin-content-docs/lib/versions/version.js:154), so each later
    cut moves readers on its own and there is nothing to keep in step. Setting it
    explicitly would pin readers to the first release forever.
  • Step 3 — hold the dropdown back until a snapshot exists, with the reason.
  • Step 4 — the snapshot's own copy of the quick start note and its install lines
    get the versions that shipped.
  • Step 5 — each version gets its own search index (build/search-index.json,
    build/next/search-index.json); search from a /next/ page and confirm the hit
    stays under /next/.

New rule: snapshots are cut for released versions only, so the navbar never
offers a version the SDK has not tagged and a reader cannot install. Today that is
v0.2.0 alone — main has been bumped to 0.4.0 without a release, so no number in
between gets a snapshot.

Verified while prototyping

Cut and discarded throwaway snapshots to confirm the behaviour this encodes: two
snapshots coexist (versions.json prepends, newest served at /, older at /X.Y/,
docs/ at /next/), each with its own search index and correctly prefixed URLs;
the dropdown lists all versions; and with no snapshot the dropdown degrades to a
plain link. All builds clean.

Release day

npm run docusaurus docs:version 1.0, the versions.current label from step 2, and
the dropdown swap.

🤖 Generated with Claude Code

…pshot

Nothing is versioned yet, so this adds only what the first snapshot needs to
be one command later, and leaves the single-version site exactly as it was.

`editCurrentVersion` sends a snapshot's "Edit this page" to docs/, so the
stock link cannot invite a new feature into a frozen release.

AGENTS.md step 2 no longer sets `lastVersion`: it defaults to the newest name
in versions.json, so every later cut moves readers on its own. Step 1 now says
to cut from an up-to-date master as the last step before the pull request,
since any merge into docs/ makes an uncut snapshot stale and there is no
refresh command, only delete and cut again. Step 3 holds the dropdown back
until a snapshot exists: with none it renders as a lone link labelled after
the development version, which reads as a release.

Snapshots are cut for released versions only, so the navbar never offers a
version the SDK has not tagged and a reader cannot install.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
@JosteinGj
JosteinGj merged commit ca70ef8 into master Oct 1, 2026
4 checks passed
@JosteinGj
JosteinGj deleted the docs/docusaurus-versioning branch October 1, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant