Commit 96330ad
authored
refactor(docs): version picker left-aligned, Reference dropdown replaced with plain nav links (#177)
The version picker was buried on the right side of the navbar next to
search and theme controls, and the Reference nav entry used a
per-version dropdown while Guide was a plain link — inconsistent and
counterintuitive.
## Changes
### Navbar layout (`_master.tmpl`)
- Removed `ms-auto` from `#version-picker-container` — it was already
before `#navbar` in DOM order, so dropping the margin pushes it left
- Added `flex-grow-1` to `#navbar` so search/theme controls remain
right-aligned
Result: `[Logo] [v1.1 ▾] [Guide] [API Reference] ——— [Search] [Theme]`
### CI toc.yml generation (`publish-documentation.yml`)
- Replaced the "Reference dropdown" step (loop over all versions →
`dropdown: true` + `items:`) with two plain links — `Guide` and `API
Reference` — both pointing to the latest version
- The version picker is now the single source of truth for version
selection
### Nav link version sync (`version-switcher.js`)
- Added `updateNavLinks(version)` — rewrites `href` on all same-origin
navbar `<a>` elements to reflect the active version
- Uses `new URL(link.href)` for normalised absolute URL handling
- Same-origin guard eliminates any `javascript:` scheme path
- Version input validated against `/^\d+(\.\d+)*$/` before any DOM
mutation
- Extracted `VERSION_PATTERN` constant shared across the module
- Called on `window.load` (syncs links to the version in the current
URL) and on version-change before navigation
### Static toc.yml placeholder
- Added `API Reference` entry (pointing to `1.0/`) to reflect the
intended nav structure1 parent 22bcfef commit 96330ad
4 files changed
Lines changed: 37 additions & 15 deletions
File tree
- .github/workflows
- api-reference
- docs-versioning
- layout
- public
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 143 | + | |
| 144 | + | |
154 | 145 | | |
155 | 146 | | |
156 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
19 | 42 | | |
20 | 43 | | |
21 | 44 | | |
| |||
42 | 65 | | |
43 | 66 | | |
44 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
45 | 72 | | |
46 | 73 | | |
47 | 74 | | |
48 | 75 | | |
| 76 | + | |
| 77 | + | |
49 | 78 | | |
50 | 79 | | |
51 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments