1import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";2import manifest from "./node-docs-manifest.json";34// Mirrors sidebars.ts: the /node/docs sidebar derives from5// node-docs-manifest.json so navigation and the generated /node/llms.txt6// (tools/site_llms.ts) can never disagree about which pages are published or7// in what order. Page files themselves are assembled by tools/node_docs.ts.89type ManifestItem = { id: string; label: string; source: string };10type ManifestSection = {11 label: string | null;12 collapsed?: boolean;13 items: ManifestItem[];14};1516type SidebarItem =17 | { type: "doc"; id: string; label: string }18 | {19 type: "category";20 label: string;21 collapsed: boolean;22 items: SidebarItem[];23 };2425const nodeSidebar: SidebarItem[] = (manifest.sections as ManifestSection[]).flatMap(26 (section) => {27 const items: SidebarItem[] = section.items.map((item) => ({28 type: "doc" as const,29 id: item.id,30 label: item.label,31 }));32 if (section.label === null) return items;33 return [{34 type: "category" as const,35 label: section.label,36 collapsed: section.collapsed ?? true,37 items,38 }];39 },40);4142const sidebars: SidebarsConfig = { node: nodeSidebar };4344export default sidebars;