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.config.js file (or docusaurus.config.ts for TypeScript projects) sits at the root of your site and is the single source of truth for all site-wide settings. Docusaurus validates this file at startup and rejects unknown top-level fields, so any custom values must live inside customFields.
The file runs in Node.js and must export a config object or a function that returns one. ES Modules, CommonJS, and TypeScript are all supported.
Required fields
title
- Type:
string
<title> metadata.
docusaurus.config.js
url
- Type:
string
https://example.com/docs/, the url is https://example.com.
docusaurus.config.js
For multi-locale sites, individual locales can override
url via i18n.localeConfigs[locale].url to support multi-domain deployments.baseUrl
- Type:
string
https://example.com/my-project/, set baseUrl to /my-project/. For root-level sites use /.
docusaurus.config.js
Site metadata
tagline
- Type:
string - Default:
""
docusaurus.config.js
favicon
- Type:
string | undefined
<link rel="icon"> tag.
docusaurus.config.js
noIndex
- Type:
boolean - Default:
false
true, adds <meta name="robots" content="noindex, nofollow"> to every page to prevent search engine indexing. Useful for staging environments.
trailingSlash
- Type:
boolean | undefined - Default:
undefined
| Value | URL behavior | Emitted file |
|---|---|---|
undefined | URLs left untouched | /docs/page/index.html |
true | Trailing slash added | /docs/page/index.html |
false | Trailing slash removed | /docs/page.html |
titleDelimiter
- Type:
string - Default:
"|"
My Page | My Site.
baseUrlIssueBanner
- Type:
boolean - Default:
true
baseUrl.
Deployment fields
These fields are only required when usingdocusaurus deploy to publish to GitHub Pages.
| Field | Type | Description |
|---|---|---|
organizationName | string | GitHub username or organization that owns the repository. |
projectName | string | Name of the GitHub repository. |
deploymentBranch | string | Branch to deploy static files to. Defaults to gh-pages. |
githubHost | string | Hostname for GitHub Enterprise deployments. Defaults to github.com. |
githubPort | string | Port for GitHub Enterprise SSH. |
Error reporting
| Field | Type | Default | Description |
|---|---|---|---|
onBrokenLinks | 'ignore' | 'log' | 'warn' | 'throw' | 'throw' | Behavior when a broken internal link is detected during build. |
onBrokenAnchors | 'ignore' | 'log' | 'warn' | 'throw' | 'warn' | Behavior when a broken anchor is detected. |
onDuplicateRoutes | 'ignore' | 'log' | 'warn' | 'throw' | 'warn' | Behavior when two pages share the same route. |
plugins
- Type:
PluginConfig[]
[name, options] tuple, or an inline plugin function.
docusaurus.config.js
themes
- Type:
PluginConfig[]
docusaurus.config.js
presets
- Type:
PresetConfig[]
@docusaurus/preset-classic preset includes the docs, blog, pages, and classic theme packages.
docusaurus.config.js
themeConfig
- Type:
object
@docusaurus/theme-classic.
colorMode
Controls light/dark mode behavior.
docusaurus.config.js
navbar
docusaurus.config.js
footer
docusaurus.config.js
prism
Configures syntax highlighting via Prism.
docusaurus.config.js
algolia
Configures the DocSearch integration.
docusaurus.config.js
i18n
- Type:
object
docusaurus.config.js
| Field | Type | Description |
|---|---|---|
defaultLocale | string | The primary locale. Served at the base URL without a locale prefix. |
locales | string[] | All locales to build and deploy. Must include defaultLocale. |
path | string | Root folder for locale files, relative to the config file. Defaults to i18n. |
localeConfigs | object | Per-locale settings. See sub-fields below. |
localeConfigs[locale]):
| Field | Description |
|---|---|
label | Label shown in the locale dropdown. |
direction | Text direction: ltr (default) or rtl. |
htmlLang | BCP 47 language tag used in <html lang="...">. |
calendar | Intl calendar used for date formatting. |
path | Subfolder name within i18n/. Defaults to the locale code. |
translate | Whether to run translation for this locale. Auto-detected from the folder presence. |
url | Override the site url for this locale (multi-domain deployments). |
baseUrl | Override the computed baseUrl for this locale. |
markdown
- Type:
MarkdownConfig
docusaurus.config.js
| Field | Type | Default | Description |
|---|---|---|---|
format | 'mdx' | 'md' | 'detect' | 'mdx' | Default parser. 'detect' picks based on file extension. |
mermaid | boolean | false | Render mermaid code blocks as diagrams. |
emoji | boolean | true | Render emoji shortcodes (:smile:) as Unicode characters. |
preprocessor | function | undefined | Raw string transform applied to each file before parsing. |
parseFrontMatter | function | undefined | Custom front matter parser. Receives the default parser as a parameter. |
mdx1Compat | object | boolean | all true | Compatibility shims for MDX v1 syntax. Disabled when future.v4.mdx1CompatDisabledByDefault is set. |
anchors.maintainCase | boolean | false | Keep original heading casing in generated anchor IDs. |
remarkRehypeOptions | object | undefined | Options forwarded to remark-rehype. |
hooks.onBrokenMarkdownLinks | severity | function | 'warn' | Behavior or callback when a broken Markdown link is detected. |
hooks.onBrokenMarkdownImages | severity | function | 'throw' | Behavior or callback when a broken Markdown image is detected. |
customFields
- Type:
object - Default:
{}
useDocusaurusContext(). Docusaurus rejects any unknown top-level config fields — use customFields instead.
docusaurus.config.js
staticDirectories
- Type:
string[] - Default:
['static']
docusaurus.config.js
Additional fields
headTags — inject arbitrary HTML head tags
headTags — inject arbitrary HTML head tags
scripts — load external scripts
scripts — load external scripts
Strings or attribute objects for
<script> tags in <head>. Tags are render-blocking; add async: true or defer: true where possible.docusaurus.config.js
stylesheets — load external stylesheets
stylesheets — load external stylesheets
Strings or attribute objects for
<link> tags in <head>.docusaurus.config.js
clientModules — global client-side modules
clientModules — global client-side modules
JS or CSS files loaded on every page client-side.
docusaurus.config.js
storage — browser storage options
storage — browser storage options
Controls the browser storage type and key namespacing used by themes.
docusaurus.config.js
Complete example
The following is a realisticdocusaurus.config.ts for a TypeScript project using @docusaurus/preset-classic.
docusaurus.config.ts