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.
[
{
"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": "callouts", "title": "Callouts" },
{ "slug": "images-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": "theme", "title": "Theme" }
]
}
]"" for index.mdx.title frontmatter.navigation.json, the sidebar is built from page frontmatter: category → grouped; categoryOrder → category position; order → page position.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.