Docs restructure#350
Draft
recrwplay wants to merge 110 commits into
Draft
Conversation
✅ Deploy Preview for neo4j-docs-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two threads in one commit; they're both part of the same in-progress rearchitecture on the docs-restructure branch. Pre-existing rearchitecture --------------------------- - CSS reorganised across the docs theme: vars.css, nav.css, header.css, doc.css, docs-remix.css, neo4j-docs.css, print.css, research.css, cheat-sheet.css, breadcrumbs.css, graphgists.css, docs-ndl.css. - Legacy templates removed: developer.hbs, remix.hbs, training.hbs, navbar-end.hbs, nav-ndl.hbs, tab-row.hbs, theme.hbs, graphgist-card.hbs, graphgists-header.hbs, kb-card.hbs, kb-header.hbs, toc-newsletter.hbs, training-help.hbs. - New partials for the tabbed layout: navbar-tabs.hbs, navbar-brand.hbs, header-responsive.hbs. - Helpers added/updated: nav-aggregate.js (tab-nav merging, docset-group version selection, current-component injection), fix-nav-path.js, is-ci.js, tabs.js. - Theme/JS tweaks: 00-theme.js, 13-search.js; partials updated for the new header/toolbar/nav structure. Runtime nav fetch (slice 2a/2b) ------------------------------- - helpers/contains-url.js: recursive URL-containment helper, used by nav-tree.hbs to decide which docset block to expand for the current page (replaces the over-broad component-equality check). - helpers/json-stringify-script.js: JSON.stringify variant that escapes </script for safe embedding in <script type="application/json"> blocks. - layouts/default.hbs: data-page-* attributes on <body>; <script id="page-nav-data"> block carrying page.navigation. - partials/nav-menu.hbs: id="nav-root" on the <nav> wrapper so the client knows where to render. - partials/nav-tree.hbs: docset-list is-active condition now uses contains-url against the current page URL rather than component-name equality (fixes promoted-section expansion). - js/09-nav-fetch.js: new runtime nav module. Reads page-nav-data from the inlined script tag, fetches /docs/nav/tabNavExtra.json, builds componentHeaders from the fetched data (excluding the current component), synthesises one for the current component from page-nav-data, runs docset-group version selection, renders the result into #nav-root, and dispatches a nav:replaced event. - js/01-nav.js: per-tree init extracted into initNavTree() so it can be re-run on nav:replaced (current-page highlighting, ancestor is-active classes, toggle-handler attachment). - js/site.js: import 09-nav-fetch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
||
| promoted.forEach(function (item) { | ||
| var sectionTitle = item.content | ||
| ? item.content.replace(/<[^>]+>/g, '').trim() |
docs-home contributes nav across many tabs from many content-nav.adoc files. Antora's page.navigation for such a page concatenates all of them with no per-tab filtering. The earlier logic took page.navigation[0] as the source for the current component, which was always the get-started content — so on /docs/reference/, /docs/learn/, etc. the rendered nav had no entry for the current page, no .is-current-page was set, no ancestor got .is-active, and the CSS rule that collapses .nav-item:not(.is-active) > .nav-list hid the entire tree. Reverse the priority. The fetched tabNavExtra.json is already correctly tab-filtered during the generate step; use it as the primary source for every component+version it contains. Only fall back to page-nav-data when the page's exact component+version isn't in the fetched data — i.e. non-current pages of ungrouped docsets, which the latest-only fetched data does not include. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The build-output filename was renamed from tabNavExtra.json to tabs.json (see docs-tabbed-nav-poc). Match the client fetch URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The runtime nav fetcher previously guessed the docs site path by taking the first segment of window.location.pathname. That works for the canonical /docs/ layout but fails when docsets publish to nested paths (e.g. /docs/genai/plugin/5/) or when the local serve URL has a different prefix from the canonical site.url. Stamp the site path on <body> as data-site-path, derived from the playbook's site.url via a new site-path Handlebars helper. The runtime fetcher reads the data attribute and uses it directly to build the tabs.json URL. For staging builds where the local file layout differs from the canonical site.url, the docs-combined POC uses Antora's --url CLI flag to override site.url at build time. Every helper that derives from site.url (this one, breadcrumbs, navbar tabs, asset paths) then lines up with the actual served URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The 10-local-tabs.js file wasn't being bundled because it wasn't imported from site.js; add the import so rollup picks it up. Tab decoration now matches both the component AND the version present in the local manifest. Previously the first version of any matching component would win, so a writer on operations-manual 2025.10 could end up with a tab href pointing at the 5.x version included only in the fetched aggregate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP for DOCOPS-31