Skip to main content

Documentation 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 is the engine behind the Docusaurus documentation system. It reads Markdown and MDX files from your filesystem, builds a versioned content graph, generates sidebar navigation, and creates all documentation routes. It is included in @docusaurus/preset-classic and does not need to be installed separately when using the preset.

Installation

npm2yarn
npm install --save @docusaurus/plugin-content-docs
If you use @docusaurus/preset-classic, configure this plugin through the docs preset key instead of adding it to the plugins array.

Configuration options

OptionTypeDefaultDescription
pathstring'docs'Path to the docs content directory on the filesystem, relative to the site directory.
routeBasePathstring'docs'URL route for the docs section. Do not include a trailing slash. Use / to serve docs from the site root.
tagsBasePathstring'tags'URL route for the tags list page, prepended to routeBasePath.
editUrlstring | EditUrlFunctionundefinedBase URL for “Edit this page” links. A function receives {version, versionDocsDirPath, docPath, permalink, locale} and returns a URL string. Omit to disable edit links.
editLocalizedFilesbooleanfalseWhen true, edit links target the localized file rather than the original. Ignored when editUrl is a function.
editCurrentVersionbooleanfalseWhen true, edit links always target the current version even when browsing older versions. Ignored when editUrl is a function.
sidebarPathfalse | stringundefinedPath to the sidebars configuration file. Use false to disable sidebars entirely, or omit to generate a fully autogenerated sidebar.
sidebarCollapsiblebooleantrueWhether sidebar categories are collapsible by default.
sidebarCollapsedbooleantrueWhether sidebar categories start collapsed by default.
sidebarItemsGeneratorSidebarGeneratorbuilt-inFunction that replaces autogenerated sidebar items with real items.
numberPrefixParserboolean | PrefixParserbuilt-inControls extraction of numeric prefixes from filenames for ordering. Set false to disable, true to use the default parser.
includestring[]['**/*.{md,mdx}']Glob patterns for Markdown files to include, relative to the content path.
excludestring[]see exampleGlob patterns for Markdown files to exclude. Refines the include list.
showLastUpdateAuthorbooleanfalseDisplay the author of the last git commit for each doc.
showLastUpdateTimebooleanfalseDisplay the date of the last git commit for each doc. Requires full git history — use fetch-depth: 0 on GitHub Actions.
breadcrumbsbooleantrueShow breadcrumb navigation at the top of doc pages.
disableVersioningbooleanfalseForce the site to show only the current version, even if versioned docs exist.
includeCurrentVersionbooleantrueInclude the current (unreleased) version in the site.
lastVersionstringfirst in versions.jsonThe version shown by default and used for docs navbar items.
onlyIncludeVersionsstring[]all versionsRestrict which versions are built.
versionsVersionsConfig{}Per-version overrides for path, label, banner, badge, and index behavior.
tagsstring | false | null'tags.yml'Path to a YAML file defining pre-defined tags, relative to the docs version content directory.
onInlineTags'ignore' | 'log' | 'warn' | 'throw''warn'Behavior when docs use tags not declared in the pre-defined tags file.
docItemComponentstring'@theme/DocItem'Main doc container component (TOC, pagination, etc.).
docRootComponentstring'@theme/DocRoot'Parent of all doc pages with sidebars.
docVersionRootComponentstring'@theme/DocVersionLayout'Parent of all pages in a single version.
docsRootComponentstring'@theme/DocsRoot'Top-level parent of all docs plugin pages across versions.
docTagsListComponentstring'@theme/DocTagsListPage'Root component of the tags list page.
docTagDocListComponentstring'@theme/DocTagDocListPage'Root component of the “docs with tag X” page.
docCategoryGeneratedIndexComponentstring'@theme/DocCategoryGeneratedIndexPage'Root component for generated category index pages.
remarkPluginsany[][]Remark plugins passed to the MDX processor.
rehypePluginsany[][]Rehype plugins passed to the MDX processor.
recmaPluginsany[][]Recma plugins passed to the MDX processor.
beforeDefaultRemarkPluginsany[][]Remark plugins injected before Docusaurus’s built-in Remark plugins.
beforeDefaultRehypePluginsany[][]Rehype plugins injected before Docusaurus’s built-in Rehype plugins.

Type definitions

type EditUrlFunction = (params: {
  version: string;
  versionDocsDirPath: string;
  docPath: string;
  permalink: string;
  locale: string;
}) => string | undefined;
type PrefixParser = (filename: string) => {
  filename: string;
  numberPrefix?: number;
};
type SidebarGenerator = (generatorArgs: {
  item: {type: 'autogenerated'; dirName: string};
  version: {contentPath: string; versionName: string};
  docs: {
    id: string;
    title: string;
    frontMatter: DocFrontMatter & Record<string, unknown>;
    source: string;
    sourceDirName: string;
    sidebarPosition?: number | undefined;
  }[];
  numberPrefixParser: PrefixParser;
  isCategoryIndex: CategoryIndexMatcher;
  categoriesMetadata: {[filePath: string]: CategoryMetadata};
  defaultSidebarItemsGenerator: SidebarGenerator;
}) => Promise<SidebarItem[]>;
type VersionConfig = {
  path?: string;
  label?: string;
  banner?: 'none' | 'unreleased' | 'unmaintained';
  badge?: boolean;
  noIndex?: boolean;
  className?: string;
};

type VersionsConfig = {[versionName: string]: VersionConfig};

Example configuration

Use the id option when running multiple instances of plugin-content-docs to give each instance a unique identifier.

Markdown front matter

Individual doc files can override plugin defaults using front matter fields.
FieldTypeDefaultDescription
idstringfile path without extensionUnique document ID used for sidebar references and cross-links.
titlestringMarkdown heading or idDocument title shown in sidebar, page heading, and metadata.
sidebar_labelstringtitleText shown in the sidebar for this document.
sidebar_positionnumberautoControls ordering within an autogenerated sidebar group.
sidebar_class_namestringundefinedAdditional CSS class applied to this item’s sidebar label.
sidebar_custom_propsobjectundefinedCustom props passed through to the sidebar item.
displayed_sidebarstringundefinedForce a specific sidebar to show when viewing this doc.
pagination_labelstringsidebar_label or titleText used in next/previous pagination buttons.
pagination_nextstring | nullnext in sidebarDoc ID to link in the “Next” button. Use null to disable.
pagination_prevstring | nullprevious in sidebarDoc ID to link in the “Previous” button. Use null to disable.
hide_titlebooleanfalseHide the front matter title from the page (does not affect Markdown headings).
hide_table_of_contentsbooleanfalseHide the right-hand table of contents panel.
toc_min_heading_levelnumber2Minimum heading level shown in the TOC (2–6).
toc_max_heading_levelnumber3Maximum heading level shown in the TOC (2–6).
slugstringfile pathCustom URL path for the document.
tagsTag[]undefinedTags to apply to this document. Strings may reference keys from tags.yml.
keywordsstring[]undefined<meta name="keywords"> content for search engines.
descriptionstringfirst line of content<meta name="description"> and OpenGraph description.
imagestringundefinedOpenGraph og:image URL for social link previews.
draftbooleanfalseDraft docs are only available in development mode.
unlistedbooleanfalseUnlisted docs are hidden from navigation and sitemaps but remain accessible via direct URL.
custom_edit_urlstring | nullcomputed from editUrl optionOverride the edit link for this specific document. null disables it.
parse_number_prefixesbooleanplugin optionOverride whether numeric prefix parsing applies to this doc.
last_updateFrontMatterLastUpdateundefinedManually override the last update author or date.
docs/intro.md
---
id: intro
title: Getting Started
sidebar_label: Introduction
sidebar_position: 1
tags: [quickstart, overview]
description: A quick introduction to the project and how to get started.
---

# Getting Started

Welcome to the docs!

Versioning

When you run docusaurus docs:version 1.0.0, Docusaurus snapshots your current docs/ folder into versioned_docs/version-1.0.0/. The versions option lets you customize how each version is displayed:
versions: {
  current: {
    label: 'Next (main branch)',
    banner: 'unreleased',
  },
  '2.0.0': {
    label: '2.0.0 (stable)',
    banner: 'none',
  },
  '1.0.0': {
    label: '1.0.0 (legacy)',
    banner: 'unmaintained',
  },
},

i18n

Translated docs live under website/i18n/[locale]/docusaurus-plugin-content-docs/[versionName]/. For multi-instance setups, the path uses docusaurus-plugin-content-docs-[pluginId] instead.

Build docs developers (and LLMs) love