📦 plugin-content-docs
Provides the Docs functionality and is the default docs plugin for Docusaurus.
Installation
- 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
tip
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.
Configuration
Accepted fields:
| Name | Type | Default | Description |
|---|---|---|---|
path | string | 'docs' | Path to the docs content directory on the file system, relative to site directory. |
editUrl | string | EditUrlFunction | undefined | Base URL to edit your site. The final URL is computed by editUrl + relativeDocPath. Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links. |
editLocalizedFiles | boolean | false | The edit URL will target the localized file, instead of the original unlocalized file. Ignored when editUrl is a function. |
editCurrentVersion | boolean | false | The edit URL will always target the current version doc instead of older versions. Ignored when editUrl is a function. |
routeBasePath | string | 'docs' | URL route for the docs section of your site. DO NOT include a trailing slash. Use / for shipping docs without base path. |
tagsBasePath | string | 'tags' | URL route for the tags list page of your site. It is prepended to the routeBasePath. |
include | string[] | ['**/*.{md,mdx}'] | Array of glob patterns matching Markdown files to be built, relative to the content path. |
exclude | string[] | See example configuration | Array of glob patterns matching Markdown files to be excluded. Serves as refinement based on the include option. |
sidebarPath | false | string | undefined | Path to sidebar configuration. Use false to disable sidebars, or undefined to create a fully autogenerated sidebar. |
sidebarCollapsible | boolean | true | Whether sidebar categories are collapsible by default. See also Collapsible categories |
sidebarCollapsed | |