#127 - Fix docs nav: consistent hide:navigation and data-driven tab dropdowns#130
Conversation
…ropdowns Five pages lacked the `hide: navigation` front matter their siblings carry, which left a stray sidebar on the Python API page. Add it to all five for consistency. The top-nav tab dropdowns were hand-mirrored from mkdocs.yml in tab-dropdowns.js and had drifted (missing the Python API Usage entry, no Benchmarking section). Replace the hardcoded map with a MkDocs hook (hooks/nav_dropdowns.py) that serializes the real nav into window.NV_NAV at build time, so the dropdowns stay in sync with mkdocs.yml automatically. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Ramya Gurunathan <rgurunathan@nvidia.com>
|
| Filename | Overview |
|---|---|
| hooks/nav_dropdowns.py | New MkDocs hook that serializes the nav into window.NV_NAV; logic and hook event ordering are correct |
| docs/javascripts/tab-dropdowns.js | Hardcoded SECTIONS map replaced with window.NV_NAV; URL field rename from path to url is correctly applied |
| mkdocs.yml | Adds hooks entry to register nav_dropdowns.py; no nav structure changes |
| docs/api-reference/python.md | Adds hide: navigation front matter to match sibling pages |
| docs/benchmarks/benchmarks.md | Adds hide: navigation front matter for sidebar consistency |
| docs/benchmarks/raw_benchmarking.md | Adds hide: navigation front matter for sidebar consistency |
| docs/benchmarks/socket_benchmarking.md | Adds hide: navigation front matter for sidebar consistency |
| docs/tutorials/bare-metal-cmake-build.md | Adds hide: navigation front matter for sidebar consistency |
Reviews (1): Last reviewed commit: "#127 - Fix docs nav: consistent hide:nav..." | Re-trigger Greptile
Closes #127.
Problem
The Python API Usage page rendered a stray left sidebar (all its siblings hide it) and was missing from the top-level nav dropdown.
Root causes
hide: navigationfront matter their siblings carry:docs/api-reference/python.mddocs/benchmarks/benchmarks.mddocs/benchmarks/raw_benchmarking.mddocs/benchmarks/socket_benchmarking.mddocs/tutorials/bare-metal-cmake-build.mdmkdocs.ymlintab-dropdowns.jsand had drifted — missing the Python API Usage entry, and with no Benchmarking section at all.Fix
hide: navigationto the five pages for consistency.hooks/nav_dropdowns.py) that serializes the real nav intowindow.NV_NAVat build time.tab-dropdowns.jsnow consumes that, so the dropdowns stay in sync withmkdocs.ymlautomatically — no parallel list to maintain.Verification
mkdocs build --strictpasses; the injectedwindow.NV_NAVcontains all three multi-page sections (Benchmarking, API Reference incl. Python API Usage, Tutorials) with correct labels and URLs.🤖 Generated with Claude Code