Skip to content

Add version navigation to the built-in layout - #2

Merged
rhnvrm merged 2 commits into
mainfrom
feat/version-navigation
Nov 4, 2026
Merged

rhnvrm merged 2 commits into
mainfrom
feat/version-navigation

Conversation

@rhnvrm

@rhnvrm rhnvrm commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Versioned documentation sites currently need a custom layout to offer a version picker. Add optional current_version and [[versions]] configuration so the built-in sidebar can render it.

Each entry has a title and destination URL. URLs are used independently of base_path, so a build under /docs/v2/ can link to /docs/v1/ or an archive on another host. The publishing workflow still builds and hosts each version separately. Sites without version configuration keep their existing navigation.

The picker has a label, selects the current version, and shows a placeholder when no current version is configured. Invalid destinations, duplicate titles and an unknown current version fail before the output directory is cleaned. Custom layouts can access .CurrentVersion and .Versions.

Validation: go test ./... passes. Built two versions locally and verified in Chromium that changing the picker navigates from v2 to v1. Added coverage for config loading, URL handling, selected and placeholder states, and unversioned sites.

PR builds also skip the Pages deploy job, which otherwise fails the github-pages environment's branch protection rules.

@rhnvrm
rhnvrm merged commit 280318a into main Nov 4, 2026
2 checks passed
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