The document is only used for theme display, please go to the official site for the latest Vuepress documentation
Frontmatter
lang
Type:
stringDetails:
Language for the page.
This will override the
langoption in your site config.Also see:
title
Type:
stringDetails:
Title for the page.
If you don't specify
titlein frontmatter, content of the first level-one header (i.e.# title) will be used as the title.
description
Type:
stringDetails:
Description for the page.
This will override the
descriptionoption in your site config.Also see:
head
Type:
HeadConfig[]Details:
Extra tags in
<head>tag for the page.Example:
---
head:
- - meta
- name: foo
content: bar
- - link
- rel: canonical
href: foobar
---
2
3
4
5
6
7
8
9
Rendered as:
<head>
<meta name="foo" content="bar" />
<link rel="canonical" href="foobar" />
</head>
2
3
4
- Also see:
date
Type:
stringDetails:
Created date for the page.
You should specify the date in the form of
yyyy-MM-dd, or follow the YAML Timestamp Typeopen in new window.
permalink
Type:
stringDetails:
Permalink for the page.
This will override the default route path that determined by the file path of the page.
Also see:
permalinkPattern
Type:
stringDetails:
Pattern to generate permalink for the page.
This won't take effect if the
permalinkfrontmatter has been set.Usage:
Pattern Description :yearYear part of created date :monthMonth part of created date :dayDay part of created date :slugSlug of page filename :rawRaw route path The
:year,:monthand:daypatterns are resolved according to the following priority:- The
datefrontmatter. - The filename that matches the date pattern
yyyy-MM-dd-foobar.mdoryyyy-MM-foobar.md. - The dirname that matches the date pattern
yyyy/MM/dd/foobar.mdoryyyy/MM/foobar.md. - Fallback to
0000-00-00.
- The
Example 1:
The page filename is
foo-bar.md.The page frontmatter is:
---
date: 2021-01-03
permalinkPattern: :year/:month/:day/:slug.html
---
2
3
4
Then the permalink of the page would be 2021/01/03/foo-bar.html.
Example 2:
The page filename is
2021-01-03-bar-baz.md.The page frontmatter is:
---
permalinkPattern: :year/:month/:day/:slug.html
---
2
3
Then the permalink of the page would be 2021/01/03/bar-baz.html.
layout
Type:
stringDetails:
Layout for the page.
Layouts are provided by theme. If you don't specify this frontmatter, the default layout will be used. You should refer to the theme's own documentation to find what layouts it provides.
If the theme layouts cannot meet your needs, you can use a custom layout component.
Example:
Register a layout component in .vuepress/clientAppEnhance.ts file:
import { defineClientAppEnhance } from '@vuepress/client'
import CustomLayout from './CustomLayout.vue'
export default defineClientAppEnhance(({ app }) => {
app.component('CustomLayout', CustomLayout)
})
2
3
4
5
6
Set custom layout in frontmatter:
---
layout: CustomLayout
---
2
3
externalIcon
Type:
booleanDetails:
Whether to append an open in new window icon to external links in current page.
Also see: