Skip to content

Docs restructure#350

Draft
recrwplay wants to merge 110 commits into
masterfrom
docs-restructure
Draft

Docs restructure#350
recrwplay wants to merge 110 commits into
masterfrom
docs-restructure

Conversation

@recrwplay

@recrwplay recrwplay commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

WIP for DOCOPS-31

@recrwplay recrwplay changed the title DOCOPS-31 Docs restructure Docs restructure Dec 12, 2025
@recrwplay recrwplay marked this pull request as draft December 17, 2025 12:17
@netlify

netlify Bot commented Apr 27, 2026

Copy link
Copy Markdown

Deploy Preview for neo4j-docs-ui ready!

Name Link
🔨 Latest commit 4712c11
🔍 Latest deploy log https://app.netlify.com/projects/neo4j-docs-ui/deploys/6a4cdbe3726d7a0008c631df
😎 Deploy Preview https://deploy-preview-350--neo4j-docs-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

recrwplay and others added 4 commits April 27, 2026 16:31
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>
Comment thread src/js/09-nav-fetch.js

promoted.forEach(function (item) {
var sectionTitle = item.content
? item.content.replace(/<[^>]+>/g, '').trim()
recrwplay and others added 19 commits May 14, 2026 20:53
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants