Skip to main content
版本:3.8.1

📦 plugin-content-docs

Provides the Docs functionality and is the default docs plugin for Docusaurus.

安装流程

npm install --save @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.

配置

接受的字段:

参数类型默认值描述
pathstring'docs'文档内容目录的文件系统路径,相对于站点目录。
editUrlstring | EditUrlFunctionundefined编辑文档的基础 URL。 The final URL is computed by editUrl + relativeDocPath. 使用函数可以允许你更精细地控制每一个文件。 完全忽略这个变量就会禁用编辑链接。
editLocalizedFilesbooleanfalse编辑 URL 会指向本地化的文件,而不是原始的未翻译文件。 Ignored when editUrl is a function.
editCurrentVersionbooleanfalse编辑 URL 会永远指向当前版本文档而不是历史版本。 Ignored when editUrl is a function.
routeBasePathstring'docs'站点文档部分的 URL 前缀。 DO NOT include a trailing slash. Use / for shipping docs without base path.
tagsBasePathstring'tags'站点标签列表部分的 URL 前缀。 It is prepended to the routeBasePath.
includestring[]['**/*.{md,mdx}']相对于内容路径的 glob 模式列表,匹配到的 Markdown 文件会被构建。
excludestring[]See example configurationGlob 模式列表,匹配到的 Markdown 文件会被排除。 Serves as refinement based on the include