Auto-Discovery

Glob patterns let you add pages without updating the config every time a new file is created.

Basic glob

{
  text: 'Guides',
  prefix: '/guides',
  from: 'docs/guides/*.md',
}

prefix is required with globs. Each matched file gets the URL prefix + "/" + slug.

Text derivation

Control how page titles are derived from discovered files with textFrom:

StrategySourceExample
'filename'Filename converted to titleadd-api-route.md → "Add Api Route"
'heading'First # heading in the file# Adding an API Route → "Adding an API Route"
'frontmatter'title field in YAML front mattertitle: API Routes → "API Routes"

Default is 'filename'. Each strategy falls back to the next: frontmatter → heading → filename.

{
  text: 'Guides',
  prefix: '/guides',
  from: 'docs/guides/*.md',
  textFrom: 'frontmatter',
}

Text transform

Apply a custom transform to derived text:

{
  text: 'ADRs',
  prefix: '/adrs',
  from: 'docs/adrs/*.md',
  textTransform: (text, slug) => slug.replace(/^(\d+)-/, '$1. '),
}

This only applies to auto-discovered children. Entries with explicit text are not transformed.

Sorting

StrategyBehavior
'alpha'Alphabetical by derived text (default)
'filename'Alphabetical by filename
(a, b) => nCustom comparator on ResolvedPage
{
  text: 'ADRs',
  prefix: '/adrs',
  from: 'docs/adrs/*.md',
  sort: 'filename',
}

Excluding files

Exclude specific files from a glob match:

{
  text: 'Guides',
  prefix: '/guides',
  from: 'docs/guides/*.md',
  exclude: ['**/draft-*.md', '**/internal/**'],
}

Global excludes in the top-level exclude field apply to all sections.

Deduplication

When combining items with from, explicit entries win. If an explicit entry has the same slug as a glob-discovered file, the glob match is dropped.