Skip to content

Commit 03986bc

Browse files
kwagyemanclaude
andcommitted
nav-versions: link alias versions to their snapshot folder
Firmware releases that shipped without their own docs rebuild are listed in the switcher but carry a "snapshot" field in versions.json pointing at the folder they share. Use it for the link target so no HTML is duplicated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0a83633 commit 03986bc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/static/nav-versions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@
4545
data.versions.forEach(function (v) {
4646
var id = typeof v === "string" ? v : v.id;
4747
var label = (typeof v === "object" && v.label) ? v.label : id;
48+
// Alias versions (no folder of their own) link to their snapshot folder.
49+
var target = (typeof v === "object" && v.snapshot) ? v.snapshot : id;
4850
var li = document.createElement("li");
4951
var a = document.createElement("a");
50-
a.href = "/" + id + tail;
52+
a.href = "/" + target + tail;
5153
a.textContent = label;
5254
if (id === cur) a.setAttribute("aria-current", "true");
5355
li.appendChild(a);

0 commit comments

Comments
 (0)