1. Home
  2. ChevronRightGetting-started
  3. ChevronRightFile-System Routing

File-System Routing

Complete guide to routing, sidebar groups, ordering, and tabs — how Boltdocs turns your docs/ folder into navigation.

Your file system is your sitemap. Every .md or .mdx file inside docs/ automatically becomes a page. No route configuration, no imports — just files.


The BasicsLink

Boltdocs recursively scans your docs/ directory and maps file paths to URL routes:

FileURL
docs/index.md/docs
docs/guide.md/docs/guide
docs/guide/index.md/docs/guide
docs/guide/advanced.md/docs/guide/advanced
docs/api/config.md/docs/api/config

File extensions (.md, .mdx) are always stripped from the final URL. An index.md inside a folder resolves to the folder's root route and becomes the group's collapsible header in the sidebar.


Folders automatically create sidebar groups. Every file inside a folder is listed as a child item of that group.

docs/
├── index.md              → /docs (ungrouped, first in sidebar)
├── guide/
│   ├── index.md          → /docs/guide (group header)
│   ├── installation.md   → /docs/guide/installation
│   └── configuration.md  → /docs/guide/configuration
└── api/
    └── config.md         → /docs/api/config

The group title defaults to the capitalized folder name (guideGuide). Override with groupTitle frontmatter or theme.sidebarGroups in config.


Controlling OrderLink

Numeric Filename PrefixLink

Prefix filenames with a number to control sidebar order. The prefix is stripped from the URL:

docs/
├── 01-introduction.md    → /docs/introduction (order: 1)
├── 02-installation.md    → /docs/installation (order: 2)
├── 03-guide/
│   ├── index.md
│   ├── 01-setup.md
│   └── 02-advanced.md

sidebarPosition FrontmatterLink

Alternatively, set sidebarPosition directly in frontmatter:

---
title: Installation
sidebarPosition: 1
---
Info
Note

If both a numeric prefix and sidebarPosition exist, the frontmatter value takes precedence.

Group vs. Ungrouped Sorting (Interleaving)Link

Boltdocs merges folder groups and ungrouped pages (like troubleshooting.mdx or index.mdx located in the root of a tab directory) into a single sorted list:

  • Ungrouped items use their sidebarPosition (defaults to 999 if not set).
  • Folder groups use the order property defined in their meta.json file (defaults to 999 if not set).
  • Everything is sorted numerically ascending. If positions are identical, links come before groups.

For example, if you set:

  • index.mdx (Overview) \rightarrow sidebarPosition: 1
  • getting-started/ folder \rightarrow order: 1 in meta.json
  • advanced/ folder \rightarrow order: 2 in meta.json
  • troubleshooting.mdx \rightarrow sidebarPosition: 20

They will render in the sidebar in that exact order, keeping Troubleshooting at the absolute bottom.


Excluding FilesLink

Files or folders starting with _ are excluded from routing:

docs/
├── _drafts/              ← excluded entirely
│   └── new-feature.md
├── _shared.mdx           ← excluded from routes
└── guide/
    └── index.md          ← included normally

Exception: _index.md acts as an invisible group index for setting group-level metadata without creating a visible page.


TabsLink

Tabs divide documentation into horizontal sections above the sidebar. Tab ID is determined by wrapping a folder name in parentheses:

docs/
├── (guides)/              ← all pages belong to "guides" tab
│   ├── index.md
│   └── installation.md
├── (api)/                 ← all pages belong to "api" tab
│   └── config.md

The parentheses are stripped from the URL/docs/guides/getting-started/installation, not /docs/(guides)/getting-started/installation.

Defining Tabs in ConfigLink

boltdocs.config.ts
export default defineConfig({
  theme: {
    tabs: [
      { id: 'guides', text: 'Guides', icon: 'BookOpen' },
      { id: 'api', text: 'API', icon: 'Code2' },
      { id: 'changelog', text: 'Changelog', icon: 'History' },
    ],
  },
})

Tab Config ReferenceLink

PropertyTypeRequiredDescription
idstringMust match folder name (without parentheses).
textstringLabel shown in the tab strip.
iconstringLucide icon name or raw SVG.

Combining Tabs with i18nLink

Locale folders go inside tab folders:

docs/
├── (guides)/
│   ├── index.md          → /docs/guides (default locale)
│   └── es/
│       └── index.md      → /docs/es/guides (Spanish)

Customizing Group Titles & IconsLink

Via ConfigLink

boltdocs.config.ts
export default defineConfig({
  theme: {
    sidebarGroups: {
      guides: {
        title: 'Getting Started',
        icon: 'BookOpen',
      },
    },
  },
})

Via meta.jsonLink

Create meta.json in any folder:

docs/guide/meta.json
{
  "title": "Getting Started",
  "icon": "Rocket",
  "collapsible": true,
  "collapsed": false
}
PropertyTypeDescription
titlestringDisplay name for the sidebar group.
orderstring[] | numberExplicit ordering.
iconstringLucide icon name or raw SVG.
collapsiblebooleanWhether users can collapse the group.
collapsedbooleanWhether the group starts collapsed.

Manual SidebarLink

For complete control, define the sidebar manually:

boltdocs.config.ts
export default defineConfig({
  theme: {
    sidebar: {
      '/docs/guides': [
        { text: 'Introduction', link: '/docs/guides/getting-started/introduction' },
        { text: 'Installation', link: '/docs/guides/getting-started/installation' },
      ],
    },
  },
})
AlertTriangle
Warning

When you define theme.sidebar for a prefix, auto-discovery is disabled for that prefix.


Hiding PagesLink

To keep a page accessible but hidden from the sidebar:

docs/guide/internal-reference.md
---
title: Internal Reference
sidebarHidden: true
---

Hidden pages are still indexed for search.


Priority ScanningLink

On startup, Boltdocs prioritizes:

  1. index.* files
  2. Files matching intro*
  3. Files matching getting-started*
  4. All other files

How Routes Are BuiltLink

  flowchart TD
  A["Scan docs/ with fdir"] --> B["Filter: .md / .mdx only"]
  B --> C["Filter: Exclude _ prefixed paths"]
  C --> D["Priority sort"]
  D --> E["Parallel parse (frontmatter + headings)"]
  E --> F["Resolve path (strip version, locale, tab, number prefix)"]
  F --> G["Build RouteMeta (path, title, group, badge, tab...)"]
  G --> H["Sort routes (by position, then alphabetically)"]
  H --> I["Sidebar + Router"]
Last updated on July 27, 2026

Was this page helpful?