docs: update docs
This commit is contained in:
parent
8d3930560a
commit
f47df1449b
@ -40,6 +40,7 @@ export const themeConfig = defineNoteConfig({
|
||||
'markdownPower',
|
||||
'markdownImage',
|
||||
'markdownMath',
|
||||
'markdownInclude',
|
||||
'水印',
|
||||
],
|
||||
},
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
title: 1.0.0-rc.102 至 rc.103 更新说明
|
||||
createTime: 2024/09/24 23:45:49
|
||||
permalink: /article/6pa64b1n/
|
||||
sticky: 3
|
||||
---
|
||||
|
||||
这两个版本做了一些 破坏性的更新,主要围绕以下两个方面:
|
||||
|
||||
38
docs/3.更新说明/120.md
Normal file
38
docs/3.更新说明/120.md
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
title: 1.0.0-rc.120 更新说明
|
||||
createTime: 2024/12/08 12:16:05
|
||||
permalink: /article/r532eavn/
|
||||
sticky: 3
|
||||
---
|
||||
|
||||
当前版本包含了一些破坏性的更新,因此做一些说明。
|
||||
|
||||
<!-- more -->
|
||||
|
||||
## vuepress-plugin-md-enhance 插件迁移
|
||||
|
||||
在 [1.0.0-rc.103](./102-103.md#vuepress-plugin-md-enhance-插件迁移) 版本中,
|
||||
主题完成了一部分功能到 vuepress 官方插件的迁移工作。但依然还有部分功能尚未完成。
|
||||
|
||||
在当前版本更新中,主题对这项工作进行了新的推进,将 `markdownEnhance.include` 功能迁移到了
|
||||
[`@vuepress/plugin-markdown-include`](https://ecosystem.vuejs.press/zh/plugins/markdown/markdown-include.html) 插件。
|
||||
因此,与之关联的配置项 `plugins.markdownEnhance.include` 将被移除,并迁移到 `plugins.markdownInclude` 进行配置。
|
||||
|
||||
**如果你有自定义配置,请注意需要进行迁移。**
|
||||
|
||||
## 功能修复
|
||||
|
||||
### @vuepress/plugin-git
|
||||
|
||||
在 `1.0.0-rc.119` 版本中,我重构了 [@vuepress/plugin-git](https://ecosystem.vuejs.press/zh/plugins/development/git.html) ,使插件能够获得更多的 git 信息,如 每个文件的 创建时间,最后修改时间,作者、提交历史记录等。
|
||||
|
||||
但与此同时也引入了新的 bug,该 bug 会导致在 私有 git 托管服务中进行构建时,在不能自动获取 贡献者头像使用 sha256
|
||||
自动生成临时头像时会导致构建失败。
|
||||
( [#334](https://github.com/pengzhanbo/vuepress-theme-plume/issues/334),
|
||||
[#349](https://github.com/pengzhanbo/vuepress-theme-plume/issues/349) )
|
||||
|
||||
另外的一个 隐性问题是,如果项目的提交记录过多,拥有数千条以上的记录时,由于读取的 git log 过多会导致内存占用过高。
|
||||
可能会导致构建时间过长甚至失败。
|
||||
|
||||
我在 [vuepress/ecosystem#292](https://github.com/vuepress/ecosystem/pull/292) 修复了相关问题,并在
|
||||
主题 `1.0.0-rc.120` 版本中进行了修复。
|
||||
61
docs/notes/theme/config/plugins/markdownInclude.md
Normal file
61
docs/notes/theme/config/plugins/markdownInclude.md
Normal file
@ -0,0 +1,61 @@
|
||||
---
|
||||
title: Markdown Include
|
||||
createTime: 2024/12/08 12:01:58
|
||||
permalink: /config/plugins/markdown-include/
|
||||
---
|
||||
|
||||
## 概述
|
||||
|
||||
在 Markdown 文件中导入其他 markdown 文件内容。
|
||||
|
||||
关联插件:[@vuepress/plugin-markdown-include](https://ecosystem.vuejs.press/zh/plugins/markdown/markdown-include.html)
|
||||
|
||||
## 配置
|
||||
|
||||
主题默认启用 `markdownInclude`。你还可以通过配置来自定义行为。
|
||||
|
||||
::: code-tabs
|
||||
@tab .vuepress/config.ts
|
||||
|
||||
```ts
|
||||
export default defineUserConfig({
|
||||
theme: plumeTheme({
|
||||
plugins: {
|
||||
markdownInclude: {
|
||||
// ... options,
|
||||
},
|
||||
}
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
### resolvePath
|
||||
|
||||
- 类型:`(path: string, cwd: string | null) => string`
|
||||
- 默认值:`(path) => path`
|
||||
- 详情:处理 include 文件路径。
|
||||
|
||||
### deep
|
||||
|
||||
- 类型:`boolean`
|
||||
- 详情:是否启用图片 Figure 支持。
|
||||
|
||||
### useComment
|
||||
|
||||
- 类型:`boolean`
|
||||
- 默认值:`true`
|
||||
- 详情:是否使用 `<!-- @include: xxx -->` 代替 `@include: xxx` 导入文件。
|
||||
|
||||
### resolveImagePath
|
||||
|
||||
- 类型:`boolean`
|
||||
- 默认值:`true`
|
||||
- 详情:是否解析包含的 Markdown 文件的里的相对图像路径。
|
||||
|
||||
### resolveLinkPath
|
||||
|
||||
- 类型:`boolean`
|
||||
- 默认值:`true`
|
||||
- 详情:是否解析包含的 Markdown 文件的里的文件相对路径。
|
||||
@ -253,13 +253,28 @@ export default defineUserConfig({
|
||||
|
||||
:::
|
||||
|
||||
### avatar
|
||||
|
||||
- 类型:`boolean`
|
||||
- 默认值:`true`
|
||||
- 描述:是否显示贡献者头像
|
||||
|
||||
### avatarPattern
|
||||
|
||||
- 类型:`string`
|
||||
- 默认值:`'https://github.com/:username.png'`
|
||||
- 描述:贡献者头像地址模式
|
||||
|
||||
`:username` 会被替换为贡献者的 用户名
|
||||
|
||||
### transform(contributors)
|
||||
|
||||
- 类型:`(contributors: GitContributor[]) => GitContributor[]`
|
||||
|
||||
```ts
|
||||
interface GitContributor {
|
||||
name: string
|
||||
name: string // 显示的名字
|
||||
username: string // git 托管服务 username
|
||||
email: string
|
||||
commits: number // 贡献者提交次数
|
||||
avatar?: string
|
||||
@ -269,6 +284,7 @@ export default defineUserConfig({
|
||||
- 描述:
|
||||
|
||||
贡献者转换函数。该函数需要返回新的 贡献者列表。
|
||||
你可以在此处补充转换逻辑,比如进行排序、去重、或者补全信息等。
|
||||
|
||||
## frontmatter
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user