Skip to content

Commit 0626e80

Browse files
authored
Attach docsetGroup to flat promoted items so version selection covers them (#123)
A promoted top-level item with no children (a flat page, e.g. a component's own index or introduction page under page-tabs-promote-all) was pushed into the tab nav unwrapped, without docsetGroup attached like every other item shape gets. Both the SSR nav-tree build (docs-ui) and the client nav-fetch rebuild skip any item lacking docsetGroup when picking which version to show, so every version's copy of that flat page rendered simultaneously - confirmed live on development.neo4j.dev's operations-manual/2026.08 pages, which showed duplicate "The Neo4j Operations Manual" and "Introduction" links pointing at both /2026.08/ and /5/. Bump to 0.3.6.
1 parent 2d259c4 commit 0626e80

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

extensions/antora/tabbed-nav/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,14 @@ module.exports.register = function ({ config }) {
560560

561561
for (const item of promotedItems) {
562562
if (!(item.items && item.items.length)) {
563+
// Unlike every other branch here, this item is pushed through
564+
// unwrapped - so it also needs docsetGroup attached directly, or it
565+
// never enters the docsetGroup version-selection logic downstream
566+
// (client nav-fetch and the SSR nav-aggregate helper both skip an
567+
// item with no docsetGroup entirely) and every version's copy of a
568+
// flat promoted page (e.g. a promoteAll'd component index or
569+
// introduction page with no children) shows up simultaneously.
570+
if (versionData.docsetGroup) item.docsetGroup = versionData.docsetGroup
563571
tabNav[0].items.push(item)
564572
continue
565573
}

extensions/antora/tabbed-nav/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@neo4j-antora/tabbed-nav",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"description": "Antora extension, Express middleware, S3 aggregator, and turnkey dev server for tabbed cross-docset navigation across Neo4j docs repos.",
55
"main": "index.js",
66
"exports": {

0 commit comments

Comments
 (0)