📦 plugin-content-docs
Provides the Docs functionality and is the default docs plugin for Docusaurus.
安装流程
- npm
- Yarn
- pnpm
- Bun
npm install --save @docusaurus/plugin-content-docs
yarn add @docusaurus/plugin-content-docs
pnpm add @docusaurus/plugin-content-docs
bun add @docusaurus/plugin-content-docs
提示
If you use the preset @docusaurus/preset-classic, you don't need to install this plugin as a dependency.
You can configure this plugin through the preset options.
配置
接受的字段:
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
path | string | 'docs' | 文档内容目录的文件系统路径,相对于站点目录。 |
editUrl | string | EditUrlFunction | undefined | 编辑文档的基础 URL。 The final URL is computed by editUrl + relativeDocPath. 使用函数可以允许你更精细地控制每一个文件。 完全忽略这个变量就会禁用编辑链接。 |
editLocalizedFiles | boolean | false | 编辑 URL 会指向本地化的文件,而不是原始的未翻译文件。 Ignored when editUrl is a function. |
editCurrentVersion | boolean | false | 编辑 URL 会永远指向当前版本文档而不是历史版本。 Ignored when editUrl is a function. |
routeBasePath | string | 'docs' | 站点文档部分的 URL 前缀。 DO NOT include a trailing slash. Use / for shipping docs without base path. |
tagsBasePath | string | 'tags' | 站点标签列表部分的 URL 前缀。 It is prepended to the routeBasePath. |
include | string[] | ['**/*.{md,mdx}'] | 相对于内容路径的 glob 模式列表,匹配到的 Markdown 文件会被构建。 |
exclude | string[] | See example configuration | Glob 模式列表,匹配到的 Markdown 文件会被排除。 Serves as refinement based on the include |