Content
Complete guide to frontmatter options for configuring page metadata
Frontmatter is the YAML metadata block at the top of every MDX file. It controls how pages are displayed, organized, and processed by Docs Kit.
---
title: "Page Title"
description: "Page description"
published: true
order: 1
---
Your content starts here...
The page title displayed in the browser tab, navigation, and page header. Keep it concise and descriptive.
title: "Getting Started Guide"A brief description used for SEO meta tags and search results. Should be 120-160 characters.
description: "Learn how to set up and configure your first project"Controls whether the page is visible on the site. Set to false for draft pages.
published: trueDetermines the sort order within navigation groups. Lower numbers appear first. If omitted, pages are sorted alphabetically.
order: 1 # This page appears first in its groupReferences an OpenAPI endpoint for automatic API documentation. Format: "METHOD /path"
openapi: "POST /api/users"Learn more in the OpenAPI Integration guide.
The title appears in multiple locations:
Best Practices:
Examples:
# Good
title: "Configuring Webhooks"
title: "Authentication with API Keys"
title: "Quick Start Guide"
# Avoid
title: "Configuration" # Too vague
title: "GETTING STARTED!!!" # Excessive caps and punctuation
title: "Everything You Need to Know About Authentication" # Too long
The description is used for:
<meta name="description">Best Practices:
Examples:
# Good
description: "Learn how to authenticate API requests using API keys, OAuth 2.0, or JWT tokens."
description: "Step-by-step guide to configuring webhook endpoints and handling event notifications."
# Avoid
description: "This page is about webhooks" # Too short, not compelling
description: "This comprehensive guide will walk you through everything you need to know about webhooks including setup, configuration, testing, debugging, and best practices." # Too long (180+ chars)
Controls page visibility throughout the site:
published: true # Page is visible everywhere
published: false # Page is hidden (draft mode)
When published: false:
robots.txt)Use Cases:
---
title: "Advanced Features"
description: "Coming soon"
published: false
---
This content is still being written...during holidays" published: false # Publish only during holidays --- ```
</Tab>
<Tab title="Beta Features">
```yaml
---
title: "Beta: Real-time Sync"
description: "Preview of upcoming sync feature"
published: false # Share URL with beta testers only
---Controls the position of pages within navigation groups:
order: 1 # Appears first
order: 10 # Appears tenth
order: 99 # Appears near the end
How It Works:
order value (ascending)order are sorted alphabeticallyExample Navigation Setup:
content/docs/
├── introduction.mdx (order: 1)
├── installation.mdx (order: 2)
├── quick-start.mdx (order: 3)
├── advanced-config.mdx (order: 10)
└── troubleshooting.mdx (no order, appears last alphabetically)
The order field only affects sorting within groups. The navigation structure
itself is defined in docs.config.ts.
References an OpenAPI endpoint for automatic API documentation:
openapi: "POST /otp/request_token"
Format:
METHOD /path/to/endpoint
What It Generates:
When you include openapi in frontmatter, Docs Kit automatically displays:
Example:
---
title: "Create User"
description: "Create a new user account"
openapi: "POST /api/users"
published: true
---
Additional context about creating users...
The endpoint supports bulk user creation by passing an array.
Learn more in Creating API Pages.
Standard documentation with explanations and guides:
---
title: "Understanding Webhooks"
description: "Learn how webhooks work and how to use them"
published: true
order: 5
---
Auto-generated API documentation:
---
title: "Get User"
description: "Retrieve user information by ID"
openapi: "GET /api/users/{id}"
published: true
---
Release notes and version history:
---
title: "API Changelog"
description: "Latest updates to the API"
published: true
order: 1
---
Homepage or section introduction:
---
title: "Welcome to Docs"
description: "Comprehensive documentation for our platform"
published: true
order: 1
---
---
title: "Building Your First Integration"
description: "Step-by-step guide to creating your first API integration in 5 minutes"
published: true
order: 1
---
---
title: "Configuration Options"
description: "Complete reference of all configuration options and environment variables"
published: true
order: 10
---
---
title: "Send SMS"
description: "Send a text message to a phone number"
openapi: "POST /api/sms/send"
published: true
---
---
title: "Advanced Rate Limiting"
description: "Advanced techniques for handling rate limits"
published: false
order: 99
---
Docs Kit validates frontmatter at build time. Common errors:
---
title: "My Page"
# ❌ Error: Missing required field 'description'
published: true
---
Fix: Add all required fields:
---
title: "My Page"
description: "Page description"
published: true
---
---
title: "My Page"
description: "Page description"
published: "yes" # ❌ Error: Expected boolean, got string
---
Fix: Use correct type:
---
published: true # ✅ Boolean value
---
---
title: My Page Without Quotes: Will Fail
description: "Valid description"
published: true
---
Fix: Quote strings with special characters:
---
title: "My Page Without Quotes: Works Now"
description: "Valid description"
published: true
---
Use consistent formatting across all pages:
# Good - Consistent style
title: "Getting started"
title: "API reference"
title: "Configuration"
# Avoid - Inconsistent capitalization
title: "Getting Started"
title: "API Reference"
title: "configuration"
Make titles and descriptions helpful:
# Good
title: "Webhook Event Types"
description: "Complete list of webhook events and their payloads"
# Avoid
title: "Events"
description: "Webhook stuff"
Use spacing between order values for flexibility:
order: 10 # Leave room to insert pages later
order: 20
order: 30
# Can easily add order: 25 between these
Next, learn about Theming to customize your site's appearance.