/docsv0.1.0

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).

content/docs/guides/content.mdx
titlestringrequired

Page heading (<h1>), metadata title, search title, and default sidebar label.

descriptionstring

Lead paragraph under the title, <meta name="description">, and llms.txt summary.

navTitlestring

Shorter label used in the sidebar and breadcrumbs instead of title.

externalstring

Absolute 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.

hiddenboolean

Hides the page from the sidebar tree while keeping its route accessible directly.

draftboolean

Excludes the page in production builds while keeping it visible in development (configurable via createSource({ drafts })).

tocbooleanDefault true

Set to false to hide the table of contents column and mobile bar on that page.

keywordsstring[]

Extra keywords included in page metadata.

updatedDate

Last-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).

content/docs/meta.json
  • List file or folder names without extensions (quickstart, not quickstart.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 pages are appended in alphabetical order (index first).
  • Listing a name that does not match a sibling .mdx, .md, or folder throws a ContentError.

Folders

A subfolder becomes a collapsible group in the sidebar. Its label is resolved in order:

  1. title in the folder's meta.json
  2. navTitle or title in the folder's index.mdx
  3. 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:

src/source.ts

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.

src/source.ts

Next steps