Navigation
Librarian uses a three-level navigation architecture designed to scale to thousands of pages.
The Three Levels
Section titled “The Three Levels”1. Top Nav — Divisions
Section titled “1. Top Nav — Divisions”The top navigation bar (src/config/menu.en.json) contains the division links: Business, Customer, Engineering, Policies. These are simple links, not dropdowns. Clicking a division takes you to the first page in that division.
The Contribute button on the right links to this Librarian section.
2. Subnav — Departments
Section titled “2. Subnav — Departments”The horizontal bar below the top nav shows the departments within the current division. This is driven automatically from the sidebar data — whatever top-level groups exist within the active division appear here as tabs.
For example, when browsing Customer pages, the subnav shows: Marketing | Sales | Support
3. Left Sidebar — Pages
Section titled “3. Left Sidebar — Pages”The left sidebar shows only the pages within the current department. It is filtered dynamically — when you’re in Customer → Marketing, you only see Marketing pages in the sidebar, not Sales or Support.
Configuration Files
Section titled “Configuration Files”src/config/sidebar.json
Section titled “src/config/sidebar.json”Defines the full content hierarchy. Structure:
{ "main": [ { "label": "Customer", "items": [ { "label": "Marketing", "autogenerate": { "directory": "customer/marketing" } }, { "label": "Sales", "autogenerate": { "directory": "customer/sales" } }, { "label": "Support", "autogenerate": { "directory": "customer/support" } } ] } ]}Top-level entries in main are divisions. Their items are departments. Department items are pages.
autogenerate — all files in the directory appear automatically, sorted by filename.
slug — links to a specific page by its path relative to src/content/docs/.
src/config/menu.en.json
Section titled “src/config/menu.en.json”Defines the top nav links. Each entry has a name and url. Dropdown menus are supported via hasChildren and children but are not used for divisions.
Adding a New Department
Section titled “Adding a New Department”- Create the directory:
src/content/docs/customer/partnerships/ - Add at least one page:
src/content/docs/customer/partnerships/overview.md - Add the department to
sidebar.jsonunder the correct division:
{ "label": "Partnerships", "autogenerate": { "directory": "customer/partnerships" } }- Restart the dev server.
Adding a New Division
Section titled “Adding a New Division”- Create the directory structure under
src/content/docs/your-division/ - Add the division to
sidebar.jsonas a new top-level entry inmain - Add a link to
src/config/menu.en.json - Restart the dev server