Frontmatter
Add title, description, and page-level metadata to MDX files.
Frontmatter is the metadata block at the top of an MDX file. It gives the template enough information to render titles, descriptions, previews, and SEO metadata.
Basic example
This example shows the smallest useful version of the pattern.
---
title: Frontmatter
description: Add title, description, and page-level metadata to MDX files.
---
Required fields
Every docs page should include a title and description. The title becomes the page heading and the description appears in the page header.
Recommended fields
These fields cover the metadata most docs and blog pages need.
| Field | Use |
|---|---|
title | The page title shown in layouts and metadata. |
description | A short summary for search, previews, and page headers. |
date | Useful for blog posts and changelogs. |
image | Useful for blog cards and article hero images. |
Description quality
Keep descriptions specific. A good description tells the reader what they will learn or complete.
Metadata mistakes
Most metadata issues are small but visible. They affect page headers, social previews, generated lists, and search results.
Vague titles
Avoid titles such as Overview, Guide, or Reference when the page is not inside enough surrounding context. A title should still make sense in search results.
Repeated descriptions
Do not reuse the same description across many pages. Repeated descriptions make docs feel unfinished and reduce the usefulness of previews.
Review before publishing
Read the metadata separately from the article body. If the title and description cannot explain the page on their own, improve them before editing the rest of the page.
Search preview
Imagine the page appearing in a command menu or search result. The metadata should help the reader choose the right page without opening several results first.