1
1
# vitepress-plugin-auto-frontmatter
2
2
3
- 这是一个适用于 ` vitepress ` 的 Vite 插件,` vitepress ` 启动时,插件会给指定的 markdown 自动生成 ` frontmatter ` 。
3
+ 这是一个适用于 ` vitepress ` 的 Vite 插件,` vitepress ` 启动时,插件会给指定的 Markdown 自动生成 ` frontmatter ` 。
4
4
5
5
## ✨ Feature
6
6
@@ -35,9 +35,9 @@ export default defineConfig({
35
35
36
36
> 说明:该插件仅限项目启动时生效。
37
37
38
- 插件默认忽略 ` frontmatter ` 中 ` layout: home ` 和 ` ["node_modules", "dist"] ` 目录下的文件,且只扫描 markdown 文档。
38
+ 插件默认忽略 ` frontmatter ` 中 ` layout: home ` 和 ` ["node_modules", "dist"] ` 目录下的文件,且只扫描 Markdown 文档。
39
39
40
- 插件默认给 markdown 文件生成 ` title ` 和 ` date ` 两个属性,其中 ` title ` 为文件名(支持带序号的文件名,如 ` 01.xx.md ` ),` date ` 为文件的创建日期。
40
+ 插件默认给 Markdown 文件生成 ` title ` 和 ` date ` 两个属性,其中 ` title ` 为文件名(支持带序号的文件名,如 ` 01.xx.md ` ),` date ` 为文件的创建日期。
41
41
42
42
``` yaml
43
43
---
@@ -53,8 +53,8 @@ date: yyyy-MM-dd hh:mm:ss
53
53
| name | description | type | default |
54
54
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | --------- | --- |
55
55
| pattern | 扫描的文件路径表达式,为 global 表达式 | `string | string[ ] ` | |
56
- | include | include 指定的对象如果不在 markdown frontmatter 存在,则忽略该文件 | ` Record<string, any> ` | |
57
- | exclude | exclude 指定的对象如果在 markdown frontmatter 存在,则忽略该文件。当 include 和 exclude 存在相同文件时,exclude 优先级高 | ` Record<string, any> ` | |
56
+ | include | include 指定的对象如果不在 Markdown frontmatter 存在,则忽略该文件 | ` Record<string, any> ` | |
57
+ | exclude | exclude 指定的对象如果在 Markdown frontmatter 存在,则忽略该文件。当 include 和 exclude 存在相同文件时,exclude 优先级高 | ` Record<string, any> ` | |
58
58
| transform | 转换处理好的 frontmatter,该函数需要返回一个新的 frontmatter 或只返回 undefined,如果返回 {},则清空 MD 文件本身存在的 frontmatter | `(frontmatter: Record<string, any>, fileInfo: FileInfo) => Record<string, any> | void` | |
59
59
| globOptions | tinyglobby 的配置项,\* 插件默认已经忽略 node_modules 和 dist 目录的所有文件 | ` GlobOptions ` | |
60
60
@@ -273,11 +273,11 @@ export interface AutoFrontmatterOption {
273
273
*/
274
274
pattern? : string | string [];
275
275
/**
276
- * include 指定的对象如果不在 markdown frontmatter 存在,则忽略该文件
276
+ * include 指定的对象如果不在 Markdown frontmatter 存在,则忽略该文件
277
277
*/
278
278
include? : Record <string , any >;
279
279
/**
280
- * exclude 指定的对象如果在 markdown frontmatter 存在,则忽略该文件。当 include 和 exclude 存在相同文件时,exclude 优先级高
280
+ * exclude 指定的对象如果在 Markdown frontmatter 存在,则忽略该文件。当 include 和 exclude 存在相同文件时,exclude 优先级高
281
281
*/
282
282
exclude? : Record <string , any >;
283
283
/**
0 commit comments