feat(mdbook): version-picker always renders a label

Previously the picker silently hid when the URL didn't contain a
/<version>/ segment — which is exactly the case for `just build`
opened via file://. The reader saw no version indicator at all.

Now the picker always mounts a "version: latest" label first
(immediately, before any fetch). When a versions.json is reachable
AND we have a real version segment in the URL (so navigation is
computable), the label upgrades into the existing dropdown. On
file:// or single-version sites the static label stays.

CSS gains styling for the static "version: <name>" name span.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 4.7 committed 2026-05-12 09:57:54 -06:00
1 parent fd75d297ca
commit da00e46570
2 files changed
+68 -28

No files matched your search

+8
View File
@@ -30,6 +30,14 @@
outline: none;
}
.version-picker-name {
color: var(--fg);
font-weight: 600;
padding: 0.2em 0.45em;
border: 1px solid transparent;
border-radius: 3px;
}
.version-picker-floating {
position: fixed;
top: 0.5em;