gravitational / docs

Source code backing goteleport.com/docs
https://goteleport.com/docs
Apache License 2.0
11 stars 13 forks source link

Allow four levels of sidebar entries #486

Closed ptgott closed 4 months ago

ptgott commented 4 months ago

Currently, the code that generates the navigation sidebar from a directory tree stops at the second level of a given top-level section. However, some sections include three levels of content. This change edits the sidebar generator so it works recursively.

Also fix an issue with the DocsNavigationItems component that prevents the docs site from highlighting sidebar entries past two levels of depth. The component treats a sidebar subsection as "active" if one of its entries is equivalent to the current page path.

But if the current page path is a grandchild of a sidebar subsection, this means that the component hides the grandchild, since none of the children of the subsection is equivalent to the current page. This change determines that a sidebar subsection is "active" if the selected path starts with the subsection path.

Also edit the CSS padding of navigation links to depend on the current level of the navigation menu. This allows for indentation of submenu links beyond the second level.

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2024 3:45pm
ptgott commented 4 months ago
image