2025-11-20 21:09:26 +08:00

239 lines
6.0 KiB
Markdown

---
title: General Configuration
createTime: 2025/10/09 20:01:09
permalink: /en/config/frontmatter/basic/
---
## Overview
General Frontmatter configuration applicable to all articles.
Example:
```md
---
title: Title
createTime: 2024/03/02 20:01:09
permalink: /config/frontmatter/basic/
---
```
## Configuration
### pageLayout
- Type: `false | 'home' | 'doc' | 'custom' | 'page' | 'friends' | string`
- Default: `doc`
- Details:
Page layout mode.
- `'home'`: Homepage layout
- `'doc'`: Documentation page layout, including left sidebar, article content, right sidebar, navbar, comments, etc.
- `'page'`: Includes only the navbar and MD file content. Use this layout for custom page content.
- `'friends'`: Friends link page layout
- `'custom'`: Includes only MD file content. Use this layout for fully custom page content.
- `false`: Equivalent to `custom`
- `string`: A global component name can be passed, which will be applied as the layout component.
### pageClass
- Type: `string`
- Default: `''`
- Details:
Additional custom CSS class name for the page.
### title
- Type: `string`
- Default: `''`
- Details:
Article title.
The theme automatically populates the current filename as the article title upon file creation.
### badge
- Type: `string | { text: string, type?: 'info' | 'tip' | 'warning' | 'danger' }`
Display a badge on the right side of the article title.
### createTime
- Type: `string`
- Default: `''`
- Details:
Article creation time.
The theme automatically populates the current time as the article creation time upon file creation.
### permalink
- Type: `string`
- Default: `''`
- Details:
Article permanent link.
Upon file creation, the theme automatically populates:
- For blog-type articles: `/article/` + `8-character random string generated by nanoid` as the permanent link.
- For articles under the notes directory: The permanent link is automatically populated based on the notes configuration.
### externalLinkIcon
- Type: `boolean`
- Default: `true`
- Details:
Whether to display the external link icon for external links within the current article.
### backToTop
- Type: `boolean`
- Default: `true`
- Details:
Whether to display the back-to-top button for the current article.
### comments
- Type: `boolean`
- Default: `true`
- Details:
Whether the current article is commentable. Only takes effect when the comment feature is enabled.
### aside
- Type: `boolean | 'left'`
- Default: `true`
- Details:
Whether to display the right sidebar for the current article.
When set to `'left'`, the right sidebar will be displayed on the left side.
### navbar
- Type: `boolean`
- Default: `true`
- Details:
Whether to display the navigation bar for the current article.
### outline
- Type: `false | number | [number, number] | 'deep'`
- Default: `[2, 3]`
- Details:
The heading levels to display.
A single number indicates displaying only headings of that level.
If a tuple is passed, the first number is the minimum level and the second number is the maximum level.
`'deep'` is the same as `[2, 6]`, which displays all headings from `<h2>` to `<h6>`.
### prev
- Type: `string | { text: string, link: string, icon?: string }`
- Default: `''`
- Details:
Customize the previous article for the current article.
- For blog-type articles: The theme automatically populates the title and link of the previous article based on chronological order.
- For notes-type articles: The theme automatically populates the title and link of the previous article based on the note sidebar configuration.
### next
- Type: `string | { text: string, link: string, icon?: string }`
- Default: `''`
- Details:
Customize the next article for the current article.
- For blog-type articles: The theme automatically populates the title and link of the next article based on chronological order.
- For notes-type articles: The theme automatically populates the title and link of the next article based on the note sidebar configuration.
### readingTime
- Type: `boolean`
- Default: `true`
- Details:
Whether to display the reading time for the current article.
### lastUpdated
- Type: `boolean`
- Default: `true`
- Details:
Whether to display the last updated time for the current article.
The last updated time is automatically populated based on the git commit time.
### contributors
- Type: `boolean | string | string[]`
- Default: `true`
- Details:
Whether to display contributors for the current article. Contributors are automatically populated based on git committers.
If your article originates from a third party and git commits cannot fully list all authors, you can supplement contributors here.
For additional information, please refer to [contributors](../../guide/features/contributors.md#info).
### changelog
- Type: `boolean`
- Default: `false`
- Details:
Whether to display the page change history for the current page.
### copyright
- Type: `boolean | CopyrightLicense | CopyrightFrontmatter`
- Default: `false`
- Details:
Whether to display copyright information for the current article.
For complete information, please refer to [copyright](../../guide/features/copyright.md).
### editLink
- Type: `boolean`
- Default: `true`
- Details:
Whether to display the article edit button for the current article.
### watermark
- Type: `boolean | WatermarkOptions`
- Default: `undefined` (When the theme does not enable watermarks,
or when global watermarks are not enabled, the default value is `false`. If global watermarks are enabled, the default is `true`.)
- Details:
Configure the watermark for the current article.
When the type is boolean, it indicates whether to enable the watermark.
When the type is WatermarkOptions, it represents the watermark configuration for the current page.
You can refer to [watermark-js-plus](https://zhensherlock.github.io/watermark-js-plus/zh/config/).
### footer
- Type: `boolean`
- Default: `true`
- Details:
Whether to display the footer for the current article.