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:
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
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.llms.txt and the Open Graph description. Aim for 30 to 200 characters.description.<title> tag shown in browser tabs and search results. The page heading is unchanged.Guide, Reference, Tutorial, API. The sidebar badge is a different key, badge.3 min read. It must be a string.May 2026.React, Node.js, CLI.updated, then published.{{NAME}} placeholders. They override global attributes from docslit.json. See Variables and precedence.Sidebar and navigation
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.false to leave the page out of an autogenerated sidebar.docslit.json or sidebar_position.New. Frontmatter tag keeps meaning the page-header category.beta, alpha, preview, pre-release, in-development, new, deprecated or legacy.Layout and page elements
guide (default), overview, wide, center, frame, full or api. Aliases: default, reference, page, custom, landing. See Page layout.layout, for pages ported from Mintlify (wide, custom, frame, center).2 to 6. 3 means h2 and h3. The default is the site layout.tocDepth, or 3.false to hide the feedback widget on this page. Equivalent to hide_feedback: true.false to remove the menu.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
true to hide this page from the built site and sidebar. The page is still available in docslit dev for preview.llms.txt and the sitemap, and add a noindex tag. A page with hidden: true is built even when no sidebar lists it.noindex robots tag and keep the page out of the sitemap, search and llms.txt, while leaving it in the sidebar.false to exclude the page from site search only./new-page. Builds emit redirect stubs. Useful when you rename or reorganize pages.Examples
Minimal frontmatter
Full frontmatter
Landing page with no chrome
Beta page with a sidebar badge
Draft page
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
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
- Learn how to organize pages in the sidebar
- Choose layouts and page switches in Page layout
- Make your content searchable with search and SEO