Doccupine builds your sidebar automatically from your MDX pages. By default, it reads the page frontmatter and groups pages into categories in the order you define. For larger docs, you can take full control with a navigation.json file.
When no custom navigation is provided, Doccupine generates a structure based on each page's frontmatter.
---
title: "Navigation"
description: "Organize and structure your navigation."
date: "2025-01-15"
category: "Configuration"
categoryOrder: 3
order: 2
---This approach is great for small sets of documents. For larger projects, setting these fields on every page can become repetitive.
To centrally define the entire sidebar, create a navigation.json at your project root (the same folder where you execute npx doccupine). When present, it takes priority over page frontmatter and fully controls the navigation structure.
The simplest format is an array of categories. When using sections, this applies to the root section only.
[
{
"label": "General",
"links": [
{ "slug": "", "title": "Getting Started" },
{ "slug": "commands", "title": "Commands" }
]
},
{
"label": "Components",
"links": [
{ "slug": "headers-and-text", "title": "Headers and Text" },
{ "slug": "lists-and-tables", "title": "Lists and tables" },
{ "slug": "code", "title": "Code" },
{ "slug": "accordion", "title": "Accordion" },
{ "slug": "tabs", "title": "Tabs" },
{ "slug": "cards", "title": "Cards" },
{ "slug": "buttons", "title": "Buttons" },
{ "slug": "callouts", "title": "Callouts" },
{ "slug": "image-and-embeds", "title": "Images and embeds" },
{ "slug": "icons", "title": "Icons" },
{ "slug": "fields", "title": "Fields" },
{ "slug": "update", "title": "Update" },
{ "slug": "columns", "title": "Columns" },
{ "slug": "steps", "title": "Steps" }
]
},
{
"label": "Configuration",
"links": [
{ "slug": "globals", "title": "Globals" },
{ "slug": "navigation", "title": "Navigation" },
{ "slug": "sections", "title": "Sections" },
{ "slug": "footer-links", "title": "Footer Links" },
{ "slug": "theme", "title": "Theme" },
{ "slug": "media-and-assets", "title": "Media and assets" },
{ "slug": "fonts", "title": "Fonts" },
{ "slug": "ai-assistant", "title": "AI Assistant" },
{ "slug": "model-context-protocol", "title": "Model Context Protocol" },
{ "slug": "deployment", "title": "Deployment" }
]
}
]When using sections, you can define navigation for each section by using an object keyed by section slug. Sections without a key fall back to auto-generated navigation from frontmatter.
{
"": [
{
"label": "General",
"links": [
{ "slug": "", "title": "Getting Started" },
{ "slug": "commands", "title": "Commands" }
]
}
],
"platform": [
{
"label": "Overview",
"links": [
{ "slug": "platform/auth", "title": "Authentication" },
{ "slug": "platform/users", "title": "Users" }
]
}
]
}The key "" controls the root section. Other keys match section slugs defined in sections.json or derived from frontmatter. See Sections for details on configuring sections.
"" for index.mdx.title frontmatter.navigation.json takes priority over frontmatter. If present, it fully controls the sidebar structure for the sections it covers.
navigation.json, the sidebar is built from page frontmatter: category -> grouped; categoryOrder -> category position; order -> page position.navigation.json fall back to frontmatter-based navigation.category appear at the top level.navigation.json as the structure grows.slug must match the MDX filename (e.g., text.mdx -> text).title in navigation.json to customize sidebar labels without changing page frontmatter.