English
Frontmatter
Frontmatter configures a single page, while the theme options configure the whole site. The fields documented on this page are the ones the theme reads; fields of the VuePress core and of the plugins (title, lang, description, head, icon, date, …) work as usual and are not repeated here.
---
type: doc
outline: [2, 3]
editLink: false
---
# Page TitlePage Type
type
'home' | 'doc' | 'page' | 'content'Default
'doc'The layout the page renders. The theme registers a single layout and switches the shell from this field:
home: the home page shell — hero, features, then the page content.doc: the document page shell — the article with the outline aside and the document footer. This is the default.page: the page shell — the markdown content only, without the outline aside and the document footer.content: no layout shell at all. The page renders the bare markdown content, without navbar, sidebar or footer.
layout
stringThe name of a custom layout registered in a client config. When it is set, type is not used and the layout renders the page itself.
A page with type: content is useful for standalone pages such as a full-screen demo. A page with a custom layout is explained in Extending.
Home Page
The home page is a page with type: home. The theme renders its hero and features frontmatter first, then the markdown content of the page, then the site footer.
---
type: home
hero:
name: Theme Default
text: The default theme of VuePress
tagline: A thin layout layer ported from VitePress
image:
src: /logo.svg
alt: Theme Default
actions:
- theme: brand
text: Get Started
link: /guide/
- theme: alt
text: GitHub
link: https://github.com/vuepress
features:
- title: VitePress-like layout
details: Navbar, sidebar, outline, home page and footer, with the same CSS variables.
- title: Plugin-driven
details: Every non-layout feature is delegated to an ecosystem plugin.
footer: false
---The classic home frontmatter is still supported. home: true is deprecated: use type: home instead, and the theme logs a warning when this key is set. The flat fields below keep their classic names and are used when hero is not set:
homeDeprecated
booleanWhether the page is a home page. Deprecated: use type: home instead. The theme logs a warning when this key is set.
heroText
string | nullThe name of the project. It defaults to the site title; set it to null to hide the name.
tagline
string | nullThe text of the hero. It defaults to the site description; set it to null to hide the text.
heroImage
stringThe hero image. It is used as the source of hero.image.
heroImageDark
stringThe dark variant of the hero image.
heroAlt
stringThe alternative text of the hero image.
actions
ThemeHeroAction[]The buttons of the hero. The classic type: 'primary' | 'secondary' is supported; theme: 'brand' | 'alt' is also accepted.
Hero
hero.name
stringThe name of the project, rendered as the largest line of the hero.
hero.text
stringThe main title of the hero, rendered below the name.
hero.tagline
stringThe tagline of the hero, rendered below the text.
hero.image
DefaultTheme.ThemeableImageThe hero image. It accepts the same shapes as the logo: a URL string, { src, alt }, or { light, dark, alt } for a color-mode-aware image. The image is rendered in a decorative box and is hidden on small screens.
hero.actions
ThemeHeroAction[]The buttons of the hero. Each action has the fields below.
hero.actions[*].textRequired
stringThe text of the button.
hero.actions[*].linkRequired
stringThe link of the button.
hero.actions[*].theme
'brand' | 'alt'Default
'brand'The style of the button: brand for the filled primary button, alt for the secondary button.
hero.actions[*].target
stringThe target attribute of the link.
hero.actions[*].rel
stringThe rel attribute of the link.
Features
features
ThemeFeature[]The feature cards shown below the hero.
features[*].icon
DefaultTheme.FeatureIconThe icon of the card. It accepts:
- an Iconify name, such as
'mdi:github'— the name must contain a colon, and it is rendered by@vuepress/plugin-icon. - a string of emoji or inline SVG markup, which is rendered as HTML.
- an image:
{ src, alt? }or{ light, dark, alt? }— the same themed image shapes as the logo, with optionalwidthandheightin pixels (both default to48). - an image wrapped in a decorative box: add
wrap: trueto an image object.
features[*].titleRequired
stringThe title of the card. HTML is allowed.
features[*].detailsRequired
stringThe description of the card. HTML is allowed.
features[*].link
stringThe link of the whole card.
features[*].linkText
stringWhen link is set, the text shown at the bottom of the card next to an arrow. The card is clickable even without it.
features[*].target
stringThe target attribute of the card link.
features[*].rel
stringThe rel attribute of the card link.
Home Content
The markdown content of the home page is rendered below the features, inside the themed document styles. Write it exactly like the content of a document page, but note that the outline and the document footer are not rendered on a home page.
Set markdownStyles: false in the frontmatter to render the content without the document styles, for example when the whole section is a custom component:
---
type: home
markdownStyles: false
---
<MyLandingPage />Team and Sponsors
Team and sponsor sections have no frontmatter fields: they are composed with the exported components inside the home content. Wrap them in VPHomeContent when they should stretch to the full viewport width:
---
type: home
---
<VPHomeContent>
## Our Team
<VPTeamPage>
<VPTeamPageTitle>
<template #title>Our Team</template>
<template #lead>The people behind the project.</template>
</VPTeamPageTitle>
<VPTeamPageSection>
<template #title>Core Team</template>
<template #members>
<VPTeamMembers :members="members" />
</template>
</VPTeamPageSection>
</VPTeamPage>
</VPHomeContent>
<script setup>
import { VPHomeContent, VPTeamPage, VPTeamPageSection, VPTeamPageTitle, VPTeamMembers } from '@vuepress/theme-default/client'
const members = [
{
avatar: 'https://github.com/vuepress.png',
name: 'VuePress',
title: 'Maintainer',
links: [{ icon: 'github', link: 'https://github.com/vuepress' }],
},
]
</script>The complete prop list of the components is in Built-in Components.
Home Footer
boolean | stringDefault
trueWhether to render the site footer on this page, or the footer text of the page. A string renders that text as the page footer instead of the site footer.
booleanDefault
falseWhether to render a string footer as HTML.
Document Page
A document page is a page without a type field, or with type: doc. It renders the document shell: the article, the outline aside, and the document footer with the edit link, the last updated time, the contributors and the previous/next links.
The following fields override the theme options for one page:
outline
DefaultTheme.Outline | DefaultTheme.Outline['level'] | falseThe heading levels of the outline. See outline.
aside
boolean | 'left'Whether to render the aside, or to render it on the left. See aside.
editLink
booleanWhether to render the edit link on this page. It does not change the link target.
lastUpdated
boolean | numberWhether to show the last updated time on this page. A number is used as the timestamp in milliseconds, which is useful when the git history is not available:
---
lastUpdated: 1700000000000
---contributors
booleanWhether to show the contributors on this page.
prev
string | { text?: string; link?: string; rel?: string; target?: string } | falseThe previous page link of this page. A string is used as the link text. Set it to false to hide the link.
next
string | { text?: string; link?: string; rel?: string; target?: string } | falseThe next page link of this page, with the same shapes as prev.
sidebar
DefaultTheme.Sidebar | 'heading' | falseThe sidebar configuration of this page. See sidebar.
sidebarDepth
numberThe maximum heading depth of the 'heading' sidebar of this page.
By default the previous/next links are the neighbours of the page in the sidebar. The link text falls back to the docFooterText of the sidebar item, then to the item text.
Sidebar Structure
The fields in this section are used when the sidebar is generated from the file structure, i.e. when sidebar is 'structure', '/path/': 'structure' or { items: 'structure' }. They have no effect on a sidebar that is configured manually.
index
booleanSet it to false to hide the page from the generated sidebar.
order
numberThe position of the item among its siblings. A positive value puts the page before the pages without an order, a negative value puts it after them.
shortTitle
stringThe text of the item, it takes precedence over the page title.
icon
stringThe icon of the item, in the same form as sidebar[*].icon.
dir
SidebarDirOptionsThe options of the group that represents the directory of this page. It is only read from the README.md of the directory, the field of the other pages is ignored.
The options are documented in theme-helper: text, icon, collapsible, expanded, link, index and order.
404 Page
The theme registers a NotFound layout. VuePress generates the 404.html page with that layout, so the page shows the theme's not-found screen: an error code, a title, a quote and a link home.
The texts are configured with the notFound theme option, which is usually translated per language in locales. A page also counts as not found when its frontmatter sets layout: NotFound.
All Pages
booleanWhether to show the navbar on this page. Set it to false for a page that should render without the navbar.
pageClass
stringAn extra class added to the theme container of this page, which is useful to scope custom styles:
.vp-theme-container.my-page {
/* page styles */
}See Styles for the style file.
markdownStyles
booleanWhether to wrap the home page content in the document styles. It only applies to a home page.
Frontmatter Reference
| Field | Type | Page type | See also |
|---|---|---|---|
type | 'home' | 'doc' | 'page' | 'content' | all | Page Type |
layout | string | all | Extending |
navbar | boolean | all | All Pages |
pageClass | string | all | All Pages |
markdownStyles | boolean | home | All Pages |
hero | ThemeHero | home | Hero |
home | boolean | home | Home Page |
heroText | string | null | home | Home Page |
tagline | string | null | home | Home Page |
heroImage | string | home | Home Page |
heroImageDark | string | home | Home Page |
heroAlt | string | home | Home Page |
actions | ThemeHeroAction[] | home | Home Page |
features | ThemeFeature[] | home | Features |
footer | boolean | string | all | Home Footer |
footerHtml | boolean | all | Home Footer |
outline | DefaultTheme.Outline | number | [number, number] | false | doc | Document Page |
aside | boolean | 'left' | doc | Document Page |
editLink | boolean | doc | Document Page |
lastUpdated | boolean | number | doc | Document Page |
contributors | boolean | doc | Document Page |
prev | string | ThemePageLink | false | doc | Document Page |
next | string | ThemePageLink | false | doc | Document Page |
sidebar | DefaultTheme.Sidebar | 'heading' | false | doc | Document Page |
sidebarDepth | number | doc | Document Page |
index | boolean | doc | Sidebar Structure |
order | number | doc | Sidebar Structure |
shortTitle | string | doc | Sidebar Structure |
icon | string | doc | Sidebar Structure |
dir | SidebarDirOptions | doc | Sidebar Structure |
