Skip to content

Add sidebar tree lines, sticky breadcrumbs, and a "Collapse all" button - #2302

Merged
fdncred merged 1 commit into
nushell:mainfrom
fdncred:docs_navigation
Dec 4, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
fdncred:docs_navigation

Conversation

@fdncred

@fdncred fdncred commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

The book's sidebar is one long list, and a page doesn't say which book or section it's in. Taking a cue from Ghostty's docs, the sidebar now draws the tree and marks the path to the current page, and a breadcrumb bar under the navbar shows the same path.

Sidebar

  • Groups that fold have a chevron. When a group is also a page, its text opens the page and the chevron folds the group.
  • Each nesting level draws a guide line, green along the path to the current page and dashed under the page's own headings. The current page is a green pill.
  • The group holding the current page opens when you get there and closes when you leave. Groups you open yourself stay open.
  • "Collapse all" sits at the top of the sidebar, stays in view on screens 720px and wider, and only shows in sidebars with something to fold.
  • Eleven book groups fold: the 8 top-level groups from Installation to (Not So) Advanced, plus Modules, Standard Library and Dataframes.
  • The contributor book and language guide listed their README as both the group and its first child, so two rows lit up. I removed the child in English and in the zh-CN contributor book.

Breadcrumbs

The bar shows a trail like The Nushell Book > Programming in Nu > Modules > Using Modules. The first crumb is the page's navbar section and the rest come from the sidebar. Pages outside the sidebar, like command reference pages and blog posts, get the section and the page title.

The bar stays under the navbar while you scroll and stays on one line. When space runs out, earlier crumbs shrink to an ellipsis first. Heading jumps land below the bar, and a crumb that repeats the one before it, like Cookbook > Cookbook, shows once.

User-facing changes (Release notes)

  • Documentation pages show a breadcrumb trail under the navbar, such as The Nushell Book > Programming in Nu > Modules > Using Modules, that stays in view while you scroll.
  • The Contributor Book and Language Reference Guide sidebars no longer list their introduction page twice.

Guide lines and foldable groups in the docs sidebar

The docs sidebar draws a guide line for each nesting level and marks the path to the current page in green. In the English Nushell Book, sidebar groups fold with a chevron. The group holding the current page opens when you reach it and closes when you leave, while groups you open yourself stay open. A "Collapse all" button at the top of the sidebar closes every group.

Additional notes

To try it, run npm run dev, open http://localhost:8080/book/modules/using_modules.html, scroll down, and click a heading in the sidebar.

- Show a sticky breadcrumb trail (docs section, then the sidebar groups
  leading to the page) above each page. It renders outside [vp-content]
  so site search doesn't index it as page text.
- Replace the theme's sidebar item: collapsible groups get a chevron
  toggle separate from their link, nesting levels draw guide lines, and
  the current page and its parent groups are highlighted. Groups opened
  automatically close again on navigation; groups the reader opens stay
  open.
- Add a sticky "Collapse all" button to sidebars that have collapsible
  groups.
- Make the English book's sidebar groups collapsible.
- Drop the duplicate README child from the contributor book and language
  guide sidebars (en, and zh-CN contributor book), so the group row is
  the only link to the README.
@fdncred

fdncred commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

screenshot
image

@fdncred
fdncred merged commit 4e40b73 into nushell:main Dec 4, 2026
2 checks passed
@fdncred
fdncred deleted the docs_navigation branch December 4, 2026 22:38
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.

1 participant