Skip to content

T-G5ND-site-generated-sidebar

Status: closed/done · Impact: high · Complexity: medium

Make the nav generated: expand site/site.yaml’s ordered slots into site/src/generated/sidebar.mjs so astro.config.mjs keeps only site identity and an import. D-0010-deterministic-site-assembly §3.

LocationRole today
site/astro.config.mjsHand-maintained sidebar plus the Appendix splice
site/src/generated/appendix_sidebar.mjsGenerated anchor children for Glossary/References only
site/src/routeData.tsTOC injection hardcoded to the two Appendix rosters

nav.ts in the docs service expands each manifest slot — generated: keys to their groups/pages (reference, appendix, data-model; planning and roadmap land with their phases), file:/group: entries to links and two-level groups in declared order — and emits one sidebar.mjs module. appendix_sidebar.mjs folds in. routeData.ts generalizes: roster TOC entries come from the same module keyed by route, not hardcoded ids. Nav labels register through the P1 registries.

  1. nav.ts: slot-expansion table, label registration, sidebar.mjs emission (module emission stays string-built per D-0010 §6).
  2. Reduce astro.config.mjs to identity + import.
  3. Fold appendix_sidebar.mjs into the new module; delete it.
  4. Generalize routeData.ts to a route-keyed lookup.
  5. Tests: slot-expansion fixtures, label-collision fixture; site build green.
LocationKindChange
plugin/lib/services/docs/site/nav.tsnewSlot expansion + emission
site/src/generated/sidebar.mjsnewGenerated artifact
site/src/generated/appendix_sidebar.mjsdeleteFolds into sidebar.mjs
site/astro.config.mjsmodifyThin shell
site/src/routeData.tsmodifyRoute-keyed TOC lookup
plugin/lib/services/docs/tests/modifyNav suites
  • AC-1: astro.config.mjs contains no nav labels or slugs beyond the sidebar.mjs import.
  • AC-2: Reordering slots in site.yaml reorders the rendered sidebar with no config edit.
  • AC-3: Two same-level nav entries with one label fail with exit 7.
  • AC-4: Site builds with sidebar and Appendix TOC behavior unchanged from the D-0009 P6 baseline.

Extracted from D-0010-deterministic-site-assembly Migration Phase 2.

T-R733-site-manifest-routes-ownership


← Back to Tasks