Frontmatter is validated against a Zod schema at build time, with errors written for content authors — missing fields are named and offending values echoed back. Only title is required.
Fields
| Field | Type | Default | Notes |
|---|---|---|---|
title |
string | — | Required. Page title and default sidebar label. |
description |
string | — | Meta description and search snippet. |
mode |
"doc" | "custom" |
"doc" |
custom drops all docs chrome. |
sidebar |
false | object |
— | false removes the sidebar column on this page; use sidebar.hidden to hide the page from the rail. See below. |
hideChildren |
boolean | — | Top-level alias of sidebar.hideChildren — collapse a section to a single link. |
head |
array | [] |
Extra <head> elements; merged with config.head. |
banner |
object | — | Per-page announcement shown above the page header. See below. |
draft |
boolean | false |
Excluded from production builds and the llms.txt indexes. |
noindex |
boolean | false |
Emits <meta name="robots" content="noindex">. |
searchable |
boolean | derives from noindex |
Include in the site search index. |
tableOfContents |
false | object |
— | { minHeadingLevel, maxHeadingLevel } (default 2–3). |
lastUpdated |
date | — | Overrides the git-derived date. |
socialImage |
string | — | Per-page OG image as an absolute URL or unbased logical path. |
prev / next |
string | object | false |
— | Override or disable pagination links. |
previousSlug |
string | string[] | — | Versioning rename hatch — see Redirects. |
external_link |
URL | /path |
— | Rewrite the sidebar link target. |
The sidebar object
sidebar:
order: 2
label: Quickstart # overrides title in the rail
badge:
text: New
variant: tip # default | info | note | success | tip | warning | caution | danger
hidden: false # keep the page but hide it from the rail
hideChildren: false # collapse a section to a single link
group: # when this page is a directory index.mdx
label: Getting started
badge: BetaBanner
Use banner for a page-specific announcement such as a release, migration notice, or deprecation warning:
---
title: Workers
banner:
content: This API is in beta and may change.
type: caution
---content is plain text. type accepts note, tip, caution, or danger.
Add dismissible to let readers close the banner:
banner:
content: v2 is out — see the migration guide.
type: tip
dismissible:
id: v2-release
days: 7id identifies the dismissal. Change it when the message changes so the banner appears again. days controls how long the dismissal lasts; omit it to remember the dismissal indefinitely.
For a site-wide notice, render the Banner component in BaseLayout instead. See Layouts.
Example
---
title: Configuration
description: Every option defineConfig accepts.
sidebar:
order: 9
badge:
text: Reference
variant: info
tableOfContents:
maxHeadingLevel: 2
---Removed keys
Some older keys now throw a guided migration error rather than failing silently:
template→mode(splash→custom)pagefind→searchablellms,aiDeprioritize,hero— removed; usenoindexor compose in the body.