TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/facebook/docusaurus/llms.txt
Use this file to discover all available pages before exploring further.
@docusaurus/plugin-content-docs plugin is the backbone of most Docusaurus sites. It organizes Markdown files into a hierarchical documentation system with sidebars, pagination, versioning, and plugin instances — giving you everything you need to maintain professional documentation at scale.
Creating your first doc
Place Markdown files in thedocs/ directory and Docusaurus automatically turns them into pages. The file path determines the document’s default URL and sidebar position.
docs/intro.md
Files prefixed with an underscore (
_) inside the docs/ directory are treated as partial pages and are not given their own route. Use them to share reusable Markdown snippets across multiple docs.Doc frontmatter
Frontmatter enriches each document with metadata. Docusaurus can infer all required metadata without it, but frontmatter gives you explicit control over IDs, titles, sidebar labels, and ordering.docs/my-doc.md
id
Unique identifier used in sidebar config and cross-doc links. Defaults to the file path relative to the docs root.
title
Page title shown in the browser tab and at the top of the page. Defaults to the first
# heading.sidebar_label
Shorter label displayed in the sidebar navigation. Falls back to
title if omitted.sidebar_position
Numeric position within the sidebar. Lower numbers appear first. Defaults to alphabetical ordering.
slug
Custom URL path for the document, overriding the file-path-derived default.
tags
Categorization tags that create tag index pages and cross-doc filtering.
Sidebar configuration
Sidebars group related documents into a navigable tree. You can let Docusaurus generate one automatically or define it manually.Auto-generated sidebar
WhensidebarPath is not set, Docusaurus generates a sidebar from the docs/ filesystem structure:
sidebars.js
sidebar_position frontmatter field controls item order within each directory level.
Manual sidebar
Define the structure explicitly to get full control over grouping, labels, and ordering:sidebars.js
docusaurus.config.js
Docs-only mode
If your site is exclusively documentation (no landing page), serve docs at the root URL by settingrouteBasePath: '/':
docusaurus.config.js
slug: / to whichever document should become the homepage:
docs/intro.md
Versioning basics
Docusaurus supports maintaining multiple documentation versions side-by-side. Run the versioning CLI to snapshot the currentdocs/ directory:
- Copies
docs/toversioned_docs/version-1.1.0/ - Saves sidebar config to
versioned_sidebars/version-1.1.0-sidebars.json - Appends
1.1.0toversions.json
Versioning behavior options
Versioning behavior options
Configure versioning with these plugin options in
docusaurus.config.js:lastVersion: Which version the/docsroute serves (defaults to the latest tagged version).includeCurrentVersion: Whether to expose the./docsfolder as a “next” version.disableVersioning: Remove all versioning and serve only the current docs.onlyIncludeVersions: Limit which versions are built (useful to speed up dev and CI).
Recommended versioning practices
Recommended versioning practices
- Only version when documentation meaningfully diverges between releases.
- Keep the number of active versions below 10 to avoid stale content accumulating.
- Use absolute imports (
@site/src/...) inside docs — relative imports break when files are copied into versioned directories.