Frontmatter Config Reference
Frontmatter enables page-based configuration. Use YAML frontmatter at the top of any markdown file to override site-level or theme-level options.Access frontmatter data via the
$frontmatter global in Vue expressions: {{ $frontmatter.title }}Site Metadata
These options override site-level configuration for individual pages.title
Title for the page. Overrides site-level
title.This becomes the page’s <title> tag and is combined with titleTemplate if configured.titleTemplate
The suffix for the title. Overrides site-level
titleTemplate.Use :title as a placeholder for the page’s main title. Set to false to disable the suffix.description
Description for the page. Overrides site-level
description.Renders as a <meta name="description"> tag.head
Additional head tags to inject for the current page. Appended after site-level head tags.
Layout
Control the page layout and structure.layout
Determines the layout of the page.
doc: Default documentation styles applied to markdown contenthome: Special layout for home/landing pages with hero and features sectionspage: Similar todocbut no styles applied - fully custom page
- doc
- home
- page
hero
home layout onlyDefines the hero section content when
layout is set to home.features
home layout onlyDefines feature items to display when
layout is set to home.Navigation & Sidebar
navbar
Whether to display the navbar on this page.
sidebar
Whether to display the sidebar on this page.
aside
Controls the aside (table of contents) rendering.
false: No asidetrue: Aside to the right'left': Aside to the left
aside.outline
The levels of headers to display in the outline.
- Number: Single level (e.g.,
2for only<h2>) - Array: Range (e.g.,
[2, 4]for<h2>to<h4>) 'deep': All levels from<h2>to<h6>(equivalent to[2, 6])false: Disable outline
outline.Footer & Navigation
footer
Whether to display the footer on this page.Overrides theme-level
footer.editLink
Whether to display the edit link in the footer of this page.Overrides theme-level
editLink.lastUpdated
Whether to display the last updated timestamp in the footer.If a
Date object is provided, it will be displayed instead of the Git timestamp.prev
Customize or disable the previous page link in the doc footer.
- String: Use as link text with auto-detected URL
- Boolean
false: Disable previous link - Object: Fully customize text and link
next
Customize or disable the next page link in the doc footer.Same options as
prev.Styling
pageClass
Add an extra CSS class name to this specific page for custom styling.
.vitepress/theme/custom.css:
Special Flags
isHome
Force the page to be treated as the home page by the theme.Useful when using a custom layout but wanting home page elements to appear.
SEO & Social
While not built-in frontmatter options, you can add custom frontmatter and use it with hooks:transformPageData:
Example: Complete Frontmatter
Here’s a comprehensive example showing many options together:Accessing Frontmatter
In Markdown
Use the$frontmatter global:
In Vue Components
Use theuseData() composable:
In Config Hooks
Access via thepageData parameter: