Frontmatter

Writing•3 min read|
|

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:

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

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. 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. An alias of description. Text shown under the page title. It replaces the description when the site shows descriptions as subtitles. A small label above the page title. Overrides the <title> tag shown in browser tabs and search results. The page heading is unchanged. 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. Estimated reading time displayed in the page header, such as 3 min read. It must be a string. The date this page was last updated, shown in the page metadata. Use a readable format like May 2026. A technology or category label shown in the page metadata. Examples: React, Node.js, CLI. The publication date used by the RSS and Atom feeds. Falls back to updated, then published. A publication date fallback for feeds. Page-level variables for {{NAME}} placeholders. They override global attributes from docslit.json. See Variables and precedence. 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. Set to false to leave the page out of an autogenerated sidebar. Sort position within an autogenerated sidebar group. Lower numbers come first. Reserved ordering hint. It is accepted, but the sidebar order comes from docslit.json or sidebar_position. A sidebar icon: a Lucide or Font Awesome name, an emoji or an image path. See Icons. Sidebar badge text, such as New. Frontmatter tag keeps meaning the page-header category. A status badge in the sidebar and the page header: beta, alpha, preview, pre-release, in-development, new, deprecated or legacy. Mark the page deprecated: a struck-through sidebar label and a Deprecated badge. The tab this page belongs to, by name or id, when no tab lists the page in its sidebar.

Layout and page elements

The page layout: guide (default), overview, wide, center, frame, full or api. Aliases: default, reference, page, custom, landing. See Page layout. An alias of layout, for pages ported from Mintlify (wide, custom, frame, center). Hide the table of contents. 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. Hide the previous and next links. Hide the feedback widget on this page. Set to false to hide the feedback widget on this page. Equivalent to hide_feedback: true. Hide the Copy page menu. Replace the site's contextual menu for this page with your own list of options. Use false to remove the menu. 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.

Visibility and publishing

Set to true to hide this page from the built site and sidebar. The page is still available in docslit dev for preview. 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. Add a noindex robots tag and keep the page out of the sitemap, search and llms.txt, while leaving it in the sidebar. Set to false to exclude the page from site search only. Redirect visitors to another page or URL, such as /new-page. Builds emit redirect stubs. Useful when you rename or reorganize pages.

Examples

Minimal frontmatter

--- title: Installation ---

Full frontmatter

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

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

Beta page with a sidebar badge

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

Draft page

--- title: Upcoming features draft: true --- 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.

API reference page

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

Next steps