string
The title of the page. By default, the page's h1 heading will be used as the title of the HTML document. But if you want to use a different title, you can use Front Matter to specify the title of the page. For example:
string
A custom description for the page. For example:
'home' | 'doc' | 'custom' | 'blank' | '404'
'doc'
The type of the page. By default, the page type is doc
. But if you want to use a different page type, you can use the Front Matter field pageType
to specify the page type. E.g:
The meaning of each pageType
config is as follows:
home
: Home page, including the layout content of the top navigation bar and home page.doc
: Doc page, including top navigation bar, left sidebar, body content, and outline bar on the right.custom
: Custom page, including top navigation bar and custom content.blank
: Also belongs to custom page, but does not include Top Navigation Bar
.404
: Not found page.string
Set the suffix of the page title. When titleSuffix
is not set, the site's title is used as the suffix by default.
The default separator between the title and the suffix is -
, you can also use |
for separation:
[string, Record<string, string>][]
Specify extra head tags to be injected for the current page. Will be appended after head tags injected by site-level config.
For example, you can use these headers to specify custom meta tags for Open Graph.
Make sure to correctly define the header tag names and their attribute names.
For tags and attribute names that contain a hyphen (-
), use the camelCase format.
For example, http-equiv="refresh"
should be defined as httpEquiv: refresh
.
This is because under the hood, headers are handled by React and react-helmet-async.
Object
The hero config for the home page. It has the following types:
For example, you can use the following Front Matter to specify a page's hero config:
When setting hero.text
, you can use the |
symbol in YAML to manually control line breaks:
Or you can use HTML
to specify the hero config for the page:
Array
[]
features config of the home
page. It has the following types:
For example, you could use the following to specify the features configuration for the home
page:
Whether to show the sidebar on the left. By default, the doc
page will display the sidebar on the left. If you want to hide the sidebar on the left, you can use the following Front Matter config:
Whether to display the outline column on the right. By default, the doc
page displays the outline column on the right. You can hide the outline column with the following config:
Whether to display the components at the bottom of the document (such as previous/next page). By default, the doc
page will display the footer at the bottom. You can hide the footer with the following config:
Whether to hide the top navigation bar. You can hide the top nav bar with the following config:
number[]
[2]
The headers shown in the overview page. By default, the displayed header is h2. But if you want to display different headers, you can specify it using the overviewHeaders
Front Matter field. For example:
Or
string
After configuration, the data-context
attribute will be added to the DOM node when the sidebar is generated, and the value is the configured value.
The DOM structure of the final generated sidebar is abbreviated as follows: