---
title: Frontmatter
description: Configure page metadata like title, description, tags, and layout using YAML frontmatter at the top of each Markdown file.
tag: Writing
readtime: 3 min read
---
> For AI agents: the complete documentation index is at [llms.txt](https://docs.docslit.com/0.3/llms.txt). This page as Markdown: [writing-content/frontmatter.md](https://docs.docslit.com/0.3/writing-content/frontmatter.md).


# Frontmatter

Every Markdown page can include YAML frontmatter at the top of the file. Frontmatter controls the page title, metadata, and behavior.

## Basic frontmatter

Add a YAML block between `---` delimiters at the top of your `.md` file:

```markdown filename="docs/my-page.md"
---
title: My page title
tag: Guide
readtime: 3 min read
---

# My page title

Your content starts here.
```

## Available fields

Every key below is in the frontmatter JSON Schema, which `docslit validate` uses. Keys you do not set take their defaults. `snake_case` is the canonical spelling for the layout and visibility keys, and `kebab-case` and `camelCase` spellings are accepted too.

### Content

<wc-fields header="Content keys">
<wc-field name="title" type="string" required>
The page title. Displayed in the browser tab and used by the heading, search indexing, `llms.txt` and the sidebar. If you omit it, DocsLit uses the text of the first `# ` heading (outside code blocks, with inline Markdown removed), and then the file name. The derived title isn't added to the page's `.md` copy.
</wc-field>
<wc-field name="description" type="string">
A short summary of the page. Used for SEO meta tags, search, `llms.txt` and the Open Graph description. Aim for 30 to 200 characters.
</wc-field>
<wc-field name="desc" type="string">
An alias of `description`.
</wc-field>
<wc-field name="subtitle" type="string">
Text shown under the page title. It replaces the description when the site shows descriptions as subtitles.
</wc-field>
<wc-field name="eyebrow" type="string">
A small label above the page title.
</wc-field>
<wc-field name="headline" type="string">
Overrides the `<title>` tag shown in browser tabs and search results. The page heading is unchanged.
</wc-field>
<wc-field name="tag" type="string">
A category label displayed as a badge next to the page title. Common values: `Guide`, `Reference`, `Tutorial`, `API`. The sidebar badge is a different key, `badge`.
</wc-field>
<wc-field name="readtime" type="string">
Estimated reading time displayed in the page header, such as `3 min read`. It must be a string.
</wc-field>
<wc-field name="updated" type="string">
The date this page was last updated, shown in the page metadata. Use a readable format like `May 2026`.
</wc-field>
<wc-field name="component" type="string">
A technology or category label shown in the page metadata. Examples: `React`, `Node.js`, `CLI`.
</wc-field>
<wc-field name="date" type="string">
The publication date used by the RSS and Atom feeds. Falls back to `updated`, then `published`.
</wc-field>
<wc-field name="published" type="string">
A publication date fallback for feeds.
</wc-field>
<wc-field name="attributes" type="object">
Page-level variables for `{{NAME}}` placeholders. They override global attributes from `docslit.json`. See [Variables and precedence](variables-and-precedence).
</wc-field>
</wc-fields>

### Sidebar and navigation

<wc-fields header="Sidebar and navigation keys">
<wc-field name="sidebar_title" type="string">
The label this page gets in the sidebar, instead of `title`. Use it to shorten a long title. The page heading and browser tab still use `title`. An object entry with a `title` in `docslit.json` overrides it. See [Pages and navigation](pages-and-navigation#page-slugs).
</wc-field>
<wc-field name="sidebar" type="boolean">
Set to `false` to leave the page out of an [autogenerated sidebar](autogenerated-sidebars).
</wc-field>
<wc-field name="sidebar_position" type="number">
Sort position within an autogenerated sidebar group. Lower numbers come first.
</wc-field>
<wc-field name="order" type="number">
Reserved ordering hint. It is accepted, but the sidebar order comes from `docslit.json` or `sidebar_position`.
</wc-field>
<wc-field name="icon" type="string">
A sidebar icon: a Lucide or Font Awesome name, an emoji or an image path. See [Icons](../components/icons).
</wc-field>
<wc-field name="badge" type="string">
Sidebar badge text, such as `New`. Frontmatter `tag` keeps meaning the page-header category.
</wc-field>
<wc-field name="availability" type="string">
A status badge in the sidebar and the page header: `beta`, `alpha`, `preview`, `pre-release`, `in-development`, `new`, `deprecated` or `legacy`.
</wc-field>
<wc-field name="deprecated" type="boolean">
Mark the page deprecated: a struck-through sidebar label and a Deprecated badge.
</wc-field>
<wc-field name="tab" type="string">
The [tab](../customization/tabs-and-anchors) this page belongs to, by name or id, when no tab lists the page in its sidebar.
</wc-field>
</wc-fields>

### Layout and page elements

<wc-fields header="Layout keys">
<wc-field name="layout" type="string">
The page layout: `guide` (default), `overview`, `wide`, `center`, `frame`, `full` or `api`. Aliases: `default`, `reference`, `page`, `custom`, `landing`. See [Page layout](../customization/page-layout#choose-a-layout-for-a-page).
</wc-field>
<wc-field name="mode" type="string">
An alias of `layout`, for pages ported from Mintlify (`wide`, `custom`, `frame`, `center`).
</wc-field>
<wc-field name="hide_toc" type="boolean">
Hide the table of contents.
</wc-field>
<wc-field name="toc_depth" type="integer">
The deepest heading level in the table of contents, from `2` to `6`. `3` means `h2` and `h3`. The default is the site `layout.tocDepth`, or `3`.
</wc-field>
<wc-field name="hide_nav" type="boolean">
Hide the previous and next links.
</wc-field>
<wc-field name="hide_feedback" type="boolean">
Hide the [feedback widget](../customization/feedback-widget) on this page.
</wc-field>
<wc-field name="feedback" type="boolean">
Set to `false` to hide the feedback widget on this page. Equivalent to `hide_feedback: true`.
</wc-field>
<wc-field name="hide_actions" type="boolean">
Hide the **Copy page** menu.
</wc-field>
<wc-field name="contextual" type="array | false">
Replace the site's [contextual menu](../customization/contextual-menu) for this page with your own list of options. Use `false` to remove the menu.
</wc-field>
<wc-field name="ogImage" type="boolean">
Set to `false` to skip the generated Open Graph image for this page. Images are generated only when enabled for the site (`docslit build --og-images`, `"ogImage": true` or `"build": { "ogImages": true }`), so this field only matters when they are on.
</wc-field>
</wc-fields>

### Visibility and publishing

<wc-fields header="Visibility keys">
<wc-field name="draft" type="boolean" default="false">
Set to `true` to hide this page from the built site and sidebar. The page is still available in `docslit dev` for preview.
</wc-field>
<wc-field name="hidden" type="boolean">
Build the page but leave it out of the sidebar, search, `llms.txt` and the sitemap, and add a `noindex` tag. A page with `hidden: true` is built even when no sidebar lists it.
</wc-field>
<wc-field name="noindex" type="boolean">
Add a `noindex` robots tag and keep the page out of the sitemap, search and `llms.txt`, while leaving it in the sidebar.
</wc-field>
<wc-field name="searchable" type="boolean">
Set to `false` to exclude the page from site search only.
</wc-field>
<wc-field name="redirect" type="string">
Redirect visitors to another page or URL, such as `/new-page`. Builds emit redirect stubs. Useful when you rename or reorganize pages.
</wc-field>
</wc-fields>

## Examples

### Minimal frontmatter

```yaml
---
title: Installation
---
```

### Full frontmatter

```yaml
---
title: Authentication guide
description: Learn how to set up authentication with API keys and OAuth
tag: Guide
readtime: 5 min read
updated: January 2026
component: Auth
---
```

### Landing page with no chrome

```yaml
---
title: Welcome
description: Start here.
layout: full
hide_actions: true
---
```

### Beta page with a sidebar badge

```yaml
---
title: Streaming API
description: Stream events as they happen.
availability: beta
badge: New
icon: radio
---
```

### Draft page

```yaml
---
title: Upcoming features
draft: true
---
```

<wc-callout type="info" title="Draft pages in dev mode">
Pages with `draft: true` are visible when you run `docslit dev` so you can preview them. They are excluded from `docslit build` output and hidden from the sidebar in production.
</wc-callout>

### API reference page

```yaml
---
title: Create a user
description: Create a new user account
layout: api
---
```

Pages with `layout: api` use a three-column layout with an examples panel. `docslit openapi scaffold` sets it for you. See [OpenAPI integration](../integrations/openapi) for the full workflow.

## Metadata display

When you include `tag`, `readtime`, `updated`, or `component` in your frontmatter, DocsLit automatically renders a metadata bar below the page title. You do not need to add any extra markup.

## Check frontmatter with the schema

Run `docslit schema frontmatter` to print the JSON Schema for every key on this page. `docslit validate` warns about keys it does not know. See [Machine-readable CLI](../ai-and-agents/machine-readable-cli#schema).

## Next steps

- Learn how to organize pages in the [sidebar](pages-and-navigation)
- Choose layouts and page switches in [Page layout](../customization/page-layout)
- Make your content searchable with [search and SEO](search-and-seo)
