Skip to content

Versioned documentation: per-release snapshots, switcher, and version-sticky navigation - #1

Open
GuanzhouSong wants to merge 4 commits into
upstream-baselinefrom
versioned-docs-upstream
Open

Versioned documentation: per-release snapshots, switcher, and version-sticky navigation#1
GuanzhouSong wants to merge 4 commits into
upstream-baselinefrom
versioned-docs-upstream

Conversation

@GuanzhouSong

Copy link
Copy Markdown
Owner

What

Adds versioned-documentation support to the site, dark-launched behind configuration:

  • content.config.json sources accept versions: [{label, ref}]; the compile step clones each ref and compiles the same mappings into versioned/<label>/. Ships with versions: [] — zero behavior change until a version is listed.
  • Routes /docs/versions/<version>/<section>/… render archived snapshots with a frozen-version banner, noindex metadata, and version-sticky navigation (back link, section list, and sidebar all stay inside the version). /docs/versions lists current + archived versions.
  • Every docs page gets a version switcher naming the current release; breadcrumbs (Docs / <version> / Section / Page) across article, reference, and version pages.
  • SEO guards: snapshots are noindex and excluded from the sitemap; only current docs are advertised.
  • Maps the docs repo's release-notes section into the articles tree (depends on the docs-repo PR adding that folder — merge order matters, the compile fails on missing mapped folders).

Live demo

Running with versions: [v0.114-0] against a docs fork: https://guanzhousong.github.io/documentdb.github.io/docs/ — try the switcher on Configuration vs its frozen v0.114-0 snapshot.

Review notes

Part 3 of 3 — depends on GuanzhouSong/docs#2 and GuanzhouSong/docs#3 merging upstream first.

🤖 Generated with Claude Code

https://claude.ai/code/session_017M2Wqc6hMjT2AZQ3ULi5wa

Content pipeline: content.config.json sources accept a 'versions' list
({label, ref}); compile-content clones each ref and compiles the same
mappings into versioned/<label>/, cleaned by compile-clean.

Routes: /docs/v/[version]/[section]/[[...slug]] renders archived article
snapshots with an old-version banner, noindex metadata, and a link back to
the current page; /docs/v/[version] is the snapshot landing; /docs/versions
lists current and archived versions. Current article pages get a version
switcher when archived copies of the page exist.

SEO: archived pages are noindex and excluded from the sitemap; only the
current docs are advertised to crawlers. Markdown internal links now honor
the configured base path (needed for project-page deployments).

Also maps the docs repo's release-notes section into the articles tree.
…switcher

Fixes version-context leaks: on archived pages the back link now goes to the
version home (not current docs) and all sidebar links stay inside the
version. Current and versioned article pages share one sidebar shell showing
the section's pages, every other section in the same version context, an
always-present version switcher (current + each archived version, targeting
the same page where it exists), and release-notes/versions footer links.
Adds Docs / version / section / page breadcrumbs on article, version-home,
and versions pages, and moves Release Notes and Documentation Versions into
a secondary row on the docs landing.
Moves archived snapshots from /docs/v/<version>/ to /docs/versions/<version>/
so the versions index and the versions themselves share one hackable
namespace (trimming URL segments walks up the hierarchy) and the v/v
stutter is gone. Names the current version in the switcher and on the
versions index (readers could not tell what 'current' was). Keeps the API
Reference visible from archived context, labeled as an exit to current
docs. Roots the reference breadcrumb at Docs for consistency, and fixes
the sitemap exclusion to skip only version subdirectories while keeping
the /docs/versions index listed.
The landing page gained a secondary meta-link row (release notes,
documentation versions); the YAML schema validation in CI rejects unknown
properties, so declare the new optional field.
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