Learn how to write documentation pages with frontmatter and markdown.
Every documentation page is a markdown file in your docsDir directory.
Each file should start with YAML frontmatter:
---
title: Page Title
description: Brief description shown in search results.
tags: [keyword, another-keyword]
---
| Field | Required | Description |
|---|---|---|
title |
Yes | Page title, used in search and browser tab |
description |
No | Short description for search results |
tags |
No | Array of keywords to improve search relevance |
Files map to URLs based on their path relative to docsDir. The basePath from your config is automatically prepended.
| File path | URL (with basePath: "") |
URL (with basePath: "/docs") |
|---|---|---|
docs/index.md |
/ |
/docs/ |
docs/quick-start.md |
/quick-start |
/docs/quick-start |
docs/api/auth.md |
/api/auth |
/docs/api/auth |
docs/api/index.md |
/api |
/docs/api |
All standard markdown is supported:
codeHeadings at levels 2-4 (##, ###, ####) automatically appear in the "On this page" table of contents on the right side.
When you run runir build or runir dev, Runir scans all markdown files and generates a search index. This powers the Ctrl/Cmd+K search dialog.
The search index includes:
Adding descriptive tags to your frontmatter significantly improves search accuracy. Use terms your users would search for.