Writing content
Files, frontmatter validation, meta.json ordering, folders, and code block annotations.
Every .mdx and .md file inside your content directory becomes a page. Files and folders whose names start with . or _ are ignored.
Files and URLs
File paths map directly to URLs under baseUrl (default /docs), and index.mdx becomes the page for its folder:
Frontmatter
Frontmatter is parsed as YAML and validated against a strict schema. Unknown keys throw a ContentError at build time (with typo suggestions for close matches).
titlestringrequiredPage heading (<h1>), metadata title, search title, and default sidebar label.
descriptionstringLead paragraph under the title, <meta name="description">, and llms.txt summary.
navTitlestringShorter label used in the sidebar and breadcrumbs instead of title.
externalstringAbsolute http(s):// URL. Turns the entry into an external link in the sidebar and skips generating a local page route.
status"new" | "beta" | "deprecated"Shows a status badge with an icon next to the page title and a compact icon indicator in the sidebar.
hiddenbooleanHides the page from the sidebar tree while keeping its route accessible directly.
draftbooleanExcludes the page in production builds while keeping it visible in development (configurable via createSource({ drafts })).
tocbooleanDefault trueSet to false to hide the table of contents column and mobile bar on that page.
keywordsstring[]Extra keywords included in page metadata.
updatedDateLast-updated date (e.g. 2026-11-28). Overrides the automatic git commit date returned by source.updated(page).
Ordering with meta.json
Any folder can contain a meta.json file with two optional fields: title (folder label in the sidebar) and pages (display order).
- List file or folder names without extensions (
quickstart, notquickstart.mdx). - Prefix an entry with
#to insert a sidebar section heading (e.g."# Reference"). Section headings also appear in breadcrumbs. - Pages or folders not listed in
pagesare appended in alphabetical order (indexfirst). - Listing a name that does not match a sibling
.mdx,.md, or folder throws aContentError.
Folders
A subfolder becomes a collapsible group in the sidebar. Its label is resolved in order:
titlein the folder'smeta.jsonnavTitleortitlein the folder'sindex.mdx- The folder name on disk
When a folder has an index.mdx, clicking the folder row navigates to that page. Without an index.mdx, the folder renders as a non-clickable group heading.
Code blocks
Fenced code blocks are highlighted at build time with @pierre/highlights for both light and dark themes at once.
Titles and line highlights
Pass title="..." and a 1-based line range {1,3-5} on the opening fence:
Which renders as:
Diffs and inline highlights
Add [!code ++], [!code --], or [!code highlight] (alias [!code hl]) inside a trailing comment (//, #, --, /* ... */, {/* ... */}, or <!-- ... -->). The comment is stripped from the rendered output, and lines marked with [!code --] are excluded when the reader clicks copy.