chore: v3.0.0-rc.0 release (#9418)

This commit is contained in:
Sébastien Lorber 2023-10-20 11:24:29 +02:00 committed by GitHub
parent 4e150d2b82
commit 7ee2f75ce1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
140 changed files with 1598 additions and 677 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "new.docusaurus.io", "name": "new.docusaurus.io",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "npx --package netlify-cli netlify dev" "start": "npx --package netlify-cli netlify dev"

View file

@ -1,6 +1,6 @@
{ {
"name": "argos", "name": "argos",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Argos visual diff tests", "description": "Argos visual diff tests",
"license": "MIT", "license": "MIT",
"private": true, "private": true,

View file

@ -1,5 +1,5 @@
{ {
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"npmClient": "yarn", "npmClient": "yarn",
"useWorkspaces": true, "useWorkspaces": true,
"useNx": false, "useNx": false,

View file

@ -1,6 +1,6 @@
{ {
"name": "create-docusaurus", "name": "create-docusaurus",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Create Docusaurus apps easily.", "description": "Create Docusaurus apps easily.",
"type": "module", "type": "module",
"repository": { "repository": {
@ -22,8 +22,8 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"commander": "^5.1.0", "commander": "^5.1.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",

View file

@ -1,6 +1,6 @@
{ {
"name": "docusaurus-2-classic-typescript-template", "name": "docusaurus-2-classic-typescript-template",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"private": true, "private": true,
"scripts": { "scripts": {
"docusaurus": "docusaurus", "docusaurus": "docusaurus",
@ -15,8 +15,8 @@
"typecheck": "tsc" "typecheck": "tsc"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/preset-classic": "3.0.0-beta.0", "@docusaurus/preset-classic": "3.0.0-rc.0",
"@mdx-js/react": "^2.3.0", "@mdx-js/react": "^2.3.0",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"prism-react-renderer": "^2.1.0", "prism-react-renderer": "^2.1.0",
@ -24,9 +24,9 @@
"react-dom": "^18.0.0" "react-dom": "^18.0.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"@docusaurus/tsconfig": "3.0.0-beta.0", "@docusaurus/tsconfig": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"typescript": "~5.2.2" "typescript": "~5.2.2"
}, },
"browserslist": { "browserslist": {

View file

@ -1,6 +1,6 @@
{ {
"name": "docusaurus-2-classic-template", "name": "docusaurus-2-classic-template",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"private": true, "private": true,
"scripts": { "scripts": {
"docusaurus": "docusaurus", "docusaurus": "docusaurus",
@ -14,8 +14,8 @@
"write-heading-ids": "docusaurus write-heading-ids" "write-heading-ids": "docusaurus write-heading-ids"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/preset-classic": "3.0.0-beta.0", "@docusaurus/preset-classic": "3.0.0-rc.0",
"@mdx-js/react": "^2.3.0", "@mdx-js/react": "^2.3.0",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"prism-react-renderer": "^2.1.0", "prism-react-renderer": "^2.1.0",
@ -23,8 +23,8 @@
"react-dom": "^18.0.0" "react-dom": "^18.0.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0" "@docusaurus/types": "3.0.0-rc.0"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/cssnano-preset", "name": "@docusaurus/cssnano-preset",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Advanced cssnano preset for maximum optimization.", "description": "Advanced cssnano preset for maximum optimization.",
"main": "lib/index.js", "main": "lib/index.js",
"license": "MIT", "license": "MIT",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/logger", "name": "@docusaurus/logger",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "An encapsulated logger for semantically formatting console messages.", "description": "An encapsulated logger for semantically formatting console messages.",
"main": "./lib/index.js", "main": "./lib/index.js",
"repository": { "repository": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/mdx-loader", "name": "@docusaurus/mdx-loader",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Docusaurus Loader for MDX", "description": "Docusaurus Loader for MDX",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -20,9 +20,9 @@
"dependencies": { "dependencies": {
"@babel/parser": "^7.22.7", "@babel/parser": "^7.22.7",
"@babel/traverse": "^7.22.8", "@babel/traverse": "^7.22.8",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"@mdx-js/mdx": "^2.1.5", "@mdx-js/mdx": "^2.1.5",
"@slorber/remark-comment": "^1.0.0", "@slorber/remark-comment": "^1.0.0",
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
@ -35,8 +35,8 @@
"mdast-util-to-string": "^3.2.0", "mdast-util-to-string": "^3.2.0",
"rehype-raw": "^6.1.1", "rehype-raw": "^6.1.1",
"remark-directive": "^2.0.1", "remark-directive": "^2.0.1",
"remark-frontmatter": "^5.0.0",
"remark-emoji": "^2.2.0", "remark-emoji": "^2.2.0",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^3.0.1", "remark-gfm": "^3.0.1",
"stringify-object": "^3.3.0", "stringify-object": "^3.3.0",
"tslib": "^2.6.0", "tslib": "^2.6.0",
@ -47,7 +47,7 @@
"webpack": "^5.88.1" "webpack": "^5.88.1"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@types/escape-html": "^1.0.2", "@types/escape-html": "^1.0.2",
"@types/mdast": "^3.0.12", "@types/mdast": "^3.0.12",
"@types/stringify-object": "^3.3.1", "@types/stringify-object": "^3.3.1",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/module-type-aliases", "name": "@docusaurus/module-type-aliases",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Docusaurus module type aliases.", "description": "Docusaurus module type aliases.",
"types": "./src/index.d.ts", "types": "./src/index.d.ts",
"publishConfig": { "publishConfig": {
@ -13,7 +13,7 @@
}, },
"dependencies": { "dependencies": {
"@docusaurus/react-loadable": "5.5.2", "@docusaurus/react-loadable": "5.5.2",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@types/history": "^4.7.11", "@types/history": "^4.7.11",
"@types/react": "*", "@types/react": "*",
"@types/react-router-config": "*", "@types/react-router-config": "*",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-client-redirects", "name": "@docusaurus/plugin-client-redirects",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Client redirects plugin for Docusaurus.", "description": "Client redirects plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -18,18 +18,18 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-common": "3.0.0-beta.0", "@docusaurus/utils-common": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"eta": "^2.2.0", "eta": "^2.2.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"tslib": "^2.6.0" "tslib": "^2.6.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/types": "3.0.0-beta.0" "@docusaurus/types": "3.0.0-rc.0"
}, },
"peerDependencies": { "peerDependencies": {
"react": "^18.0.0", "react": "^18.0.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-content-blog", "name": "@docusaurus/plugin-content-blog",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Blog plugin for Docusaurus.", "description": "Blog plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "src/plugin-content-blog.d.ts", "types": "src/plugin-content-blog.d.ts",
@ -19,13 +19,13 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/mdx-loader": "3.0.0-beta.0", "@docusaurus/mdx-loader": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-common": "3.0.0-beta.0", "@docusaurus/utils-common": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"cheerio": "^1.0.0-rc.12", "cheerio": "^1.0.0-rc.12",
"feed": "^4.2.2", "feed": "^4.2.2",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-content-docs", "name": "@docusaurus/plugin-content-docs",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Docs plugin for Docusaurus.", "description": "Docs plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"sideEffects": false, "sideEffects": false,
@ -35,13 +35,13 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/mdx-loader": "3.0.0-beta.0", "@docusaurus/mdx-loader": "3.0.0-rc.0",
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"@types/react-router-config": "^5.0.7", "@types/react-router-config": "^5.0.7",
"combine-promises": "^1.1.0", "combine-promises": "^1.1.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-content-pages", "name": "@docusaurus/plugin-content-pages",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Pages plugin for Docusaurus.", "description": "Pages plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "src/plugin-content-pages.d.ts", "types": "src/plugin-content-pages.d.ts",
@ -18,11 +18,11 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/mdx-loader": "3.0.0-beta.0", "@docusaurus/mdx-loader": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"tslib": "^2.6.0", "tslib": "^2.6.0",
"webpack": "^5.88.1" "webpack": "^5.88.1"

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-debug", "name": "@docusaurus/plugin-debug",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Debug plugin for Docusaurus.", "description": "Debug plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "src/plugin-debug.d.ts", "types": "src/plugin-debug.d.ts",
@ -20,9 +20,9 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@microlink/react-json-view": "^1.22.2", "@microlink/react-json-view": "^1.22.2",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"tslib": "^2.6.0" "tslib": "^2.6.0"

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-google-analytics", "name": "@docusaurus/plugin-google-analytics",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Global analytics (analytics.js) plugin for Docusaurus.", "description": "Global analytics (analytics.js) plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -18,9 +18,9 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"tslib": "^2.6.0" "tslib": "^2.6.0"
}, },
"peerDependencies": { "peerDependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-google-gtag", "name": "@docusaurus/plugin-google-gtag",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Global Site Tag (gtag.js) plugin for Docusaurus.", "description": "Global Site Tag (gtag.js) plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -18,9 +18,9 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"@types/gtag.js": "^0.0.12", "@types/gtag.js": "^0.0.12",
"tslib": "^2.6.0" "tslib": "^2.6.0"
}, },

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-google-tag-manager", "name": "@docusaurus/plugin-google-tag-manager",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Google Tag Manager (gtm.js) plugin for Docusaurus.", "description": "Google Tag Manager (gtm.js) plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -18,9 +18,9 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"tslib": "^2.6.0" "tslib": "^2.6.0"
}, },
"peerDependencies": { "peerDependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-ideal-image", "name": "@docusaurus/plugin-ideal-image",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder).", "description": "Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder).",
"main": "lib/index.js", "main": "lib/index.js",
"types": "src/plugin-ideal-image.d.ts", "types": "src/plugin-ideal-image.d.ts",
@ -20,12 +20,12 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/lqip-loader": "3.0.0-beta.0", "@docusaurus/lqip-loader": "3.0.0-rc.0",
"@docusaurus/responsive-loader": "^1.7.0", "@docusaurus/responsive-loader": "^1.7.0",
"@docusaurus/theme-translations": "3.0.0-beta.0", "@docusaurus/theme-translations": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"@slorber/react-ideal-image": "^0.0.12", "@slorber/react-ideal-image": "^0.0.12",
"react-waypoint": "^10.3.0", "react-waypoint": "^10.3.0",
"sharp": "^0.32.3", "sharp": "^0.32.3",
@ -33,7 +33,7 @@
"webpack": "^5.88.1" "webpack": "^5.88.1"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"fs-extra": "^11.1.0" "fs-extra": "^11.1.0"
}, },
"peerDependencies": { "peerDependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-pwa", "name": "@docusaurus/plugin-pwa",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Docusaurus Plugin to add PWA support.", "description": "Docusaurus Plugin to add PWA support.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "src/plugin-pwa.d.ts", "types": "src/plugin-pwa.d.ts",
@ -22,12 +22,12 @@
"dependencies": { "dependencies": {
"@babel/core": "^7.22.9", "@babel/core": "^7.22.9",
"@babel/preset-env": "^7.22.9", "@babel/preset-env": "^7.22.9",
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/theme-common": "3.0.0-beta.0", "@docusaurus/theme-common": "3.0.0-rc.0",
"@docusaurus/theme-translations": "3.0.0-beta.0", "@docusaurus/theme-translations": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"babel-loader": "^9.1.3", "babel-loader": "^9.1.3",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"core-js": "^3.31.1", "core-js": "^3.31.1",
@ -41,7 +41,7 @@
"workbox-window": "^6.6.1" "workbox-window": "^6.6.1"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"fs-extra": "^11.1.0" "fs-extra": "^11.1.0"
}, },
"peerDependencies": { "peerDependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/plugin-sitemap", "name": "@docusaurus/plugin-sitemap",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Simple sitemap generation plugin for Docusaurus.", "description": "Simple sitemap generation plugin for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -18,12 +18,12 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-common": "3.0.0-beta.0", "@docusaurus/utils-common": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"sitemap": "^7.1.1", "sitemap": "^7.1.1",
"tslib": "^2.6.0" "tslib": "^2.6.0"

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/preset-classic", "name": "@docusaurus/preset-classic",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Classic preset for Docusaurus.", "description": "Classic preset for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -18,19 +18,19 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/plugin-content-blog": "3.0.0-beta.0", "@docusaurus/plugin-content-blog": "3.0.0-rc.0",
"@docusaurus/plugin-content-docs": "3.0.0-beta.0", "@docusaurus/plugin-content-docs": "3.0.0-rc.0",
"@docusaurus/plugin-content-pages": "3.0.0-beta.0", "@docusaurus/plugin-content-pages": "3.0.0-rc.0",
"@docusaurus/plugin-debug": "3.0.0-beta.0", "@docusaurus/plugin-debug": "3.0.0-rc.0",
"@docusaurus/plugin-google-analytics": "3.0.0-beta.0", "@docusaurus/plugin-google-analytics": "3.0.0-rc.0",
"@docusaurus/plugin-google-gtag": "3.0.0-beta.0", "@docusaurus/plugin-google-gtag": "3.0.0-rc.0",
"@docusaurus/plugin-google-tag-manager": "3.0.0-beta.0", "@docusaurus/plugin-google-tag-manager": "3.0.0-rc.0",
"@docusaurus/plugin-sitemap": "3.0.0-beta.0", "@docusaurus/plugin-sitemap": "3.0.0-rc.0",
"@docusaurus/theme-classic": "3.0.0-beta.0", "@docusaurus/theme-classic": "3.0.0-rc.0",
"@docusaurus/theme-common": "3.0.0-beta.0", "@docusaurus/theme-common": "3.0.0-rc.0",
"@docusaurus/theme-search-algolia": "3.0.0-beta.0", "@docusaurus/theme-search-algolia": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0" "@docusaurus/types": "3.0.0-rc.0"
}, },
"peerDependencies": { "peerDependencies": {
"react": "^18.0.0", "react": "^18.0.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/remark-plugin-npm2yarn", "name": "@docusaurus/remark-plugin-npm2yarn",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Remark plugin for converting npm commands to Yarn commands as tabs.", "description": "Remark plugin for converting npm commands to Yarn commands as tabs.",
"main": "lib/index.js", "main": "lib/index.js",
"publishConfig": { "publishConfig": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/theme-classic", "name": "@docusaurus/theme-classic",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Classic theme for Docusaurus", "description": "Classic theme for Docusaurus",
"main": "lib/index.js", "main": "lib/index.js",
"types": "src/theme-classic.d.ts", "types": "src/theme-classic.d.ts",
@ -20,18 +20,18 @@
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/mdx-loader": "3.0.0-beta.0", "@docusaurus/mdx-loader": "3.0.0-rc.0",
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"@docusaurus/plugin-content-blog": "3.0.0-beta.0", "@docusaurus/plugin-content-blog": "3.0.0-rc.0",
"@docusaurus/plugin-content-docs": "3.0.0-beta.0", "@docusaurus/plugin-content-docs": "3.0.0-rc.0",
"@docusaurus/plugin-content-pages": "3.0.0-beta.0", "@docusaurus/plugin-content-pages": "3.0.0-rc.0",
"@docusaurus/theme-common": "3.0.0-beta.0", "@docusaurus/theme-common": "3.0.0-rc.0",
"@docusaurus/theme-translations": "3.0.0-beta.0", "@docusaurus/theme-translations": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-common": "3.0.0-beta.0", "@docusaurus/utils-common": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"@mdx-js/react": "^2.1.5", "@mdx-js/react": "^2.1.5",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"copy-text-to-clipboard": "^3.2.0", "copy-text-to-clipboard": "^3.2.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/theme-common", "name": "@docusaurus/theme-common",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Common code for Docusaurus themes.", "description": "Common code for Docusaurus themes.",
"main": "./lib/index.js", "main": "./lib/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
@ -30,13 +30,13 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/mdx-loader": "3.0.0-beta.0", "@docusaurus/mdx-loader": "3.0.0-rc.0",
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"@docusaurus/plugin-content-blog": "3.0.0-beta.0", "@docusaurus/plugin-content-blog": "3.0.0-rc.0",
"@docusaurus/plugin-content-docs": "3.0.0-beta.0", "@docusaurus/plugin-content-docs": "3.0.0-rc.0",
"@docusaurus/plugin-content-pages": "3.0.0-beta.0", "@docusaurus/plugin-content-pages": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-common": "3.0.0-beta.0", "@docusaurus/utils-common": "3.0.0-rc.0",
"@types/history": "^4.7.11", "@types/history": "^4.7.11",
"@types/react": "*", "@types/react": "*",
"@types/react-router-config": "*", "@types/react-router-config": "*",
@ -47,8 +47,8 @@
"utility-types": "^3.10.0" "utility-types": "^3.10.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"lodash": "^4.17.21" "lodash": "^4.17.21"
}, },

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/theme-live-codeblock", "name": "@docusaurus/theme-live-codeblock",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Docusaurus live code block component.", "description": "Docusaurus live code block component.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "src/theme-live-codeblock.d.ts", "types": "src/theme-live-codeblock.d.ts",
@ -23,10 +23,10 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/theme-common": "3.0.0-beta.0", "@docusaurus/theme-common": "3.0.0-rc.0",
"@docusaurus/theme-translations": "3.0.0-beta.0", "@docusaurus/theme-translations": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"@philpl/buble": "^0.19.7", "@philpl/buble": "^0.19.7",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
@ -34,7 +34,7 @@
"tslib": "^2.6.0" "tslib": "^2.6.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@types/buble": "^0.20.1" "@types/buble": "^0.20.1"
}, },
"peerDependencies": { "peerDependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/theme-mermaid", "name": "@docusaurus/theme-mermaid",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Mermaid components for Docusaurus.", "description": "Mermaid components for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "src/theme-mermaid.d.ts", "types": "src/theme-mermaid.d.ts",
@ -33,11 +33,11 @@
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"@docusaurus/theme-common": "3.0.0-beta.0", "@docusaurus/theme-common": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"mermaid": "^10.4.0", "mermaid": "^10.4.0",
"tslib": "^2.6.0" "tslib": "^2.6.0"
}, },

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/theme-search-algolia", "name": "@docusaurus/theme-search-algolia",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Algolia search component for Docusaurus.", "description": "Algolia search component for Docusaurus.",
"main": "lib/index.js", "main": "lib/index.js",
"sideEffects": [ "sideEffects": [
@ -34,13 +34,13 @@
}, },
"dependencies": { "dependencies": {
"@docsearch/react": "^3.5.2", "@docsearch/react": "^3.5.2",
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/plugin-content-docs": "3.0.0-beta.0", "@docusaurus/plugin-content-docs": "3.0.0-rc.0",
"@docusaurus/theme-common": "3.0.0-beta.0", "@docusaurus/theme-common": "3.0.0-rc.0",
"@docusaurus/theme-translations": "3.0.0-beta.0", "@docusaurus/theme-translations": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"algoliasearch": "^4.18.0", "algoliasearch": "^4.18.0",
"algoliasearch-helper": "^3.13.3", "algoliasearch-helper": "^3.13.3",
"clsx": "^1.2.1", "clsx": "^1.2.1",
@ -51,7 +51,7 @@
"utility-types": "^3.10.0" "utility-types": "^3.10.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0-beta.0" "@docusaurus/module-type-aliases": "3.0.0-rc.0"
}, },
"peerDependencies": { "peerDependencies": {
"react": "^18.0.0", "react": "^18.0.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/theme-translations", "name": "@docusaurus/theme-translations",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Docusaurus theme translations.", "description": "Docusaurus theme translations.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -23,8 +23,8 @@
"tslib": "^2.6.0" "tslib": "^2.6.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"lodash": "^4.17.21" "lodash": "^4.17.21"
}, },
"engines": { "engines": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/tsconfig", "name": "@docusaurus/tsconfig",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Docusaurus base TypeScript configuration.", "description": "Docusaurus base TypeScript configuration.",
"main": "tsconfig.json", "main": "tsconfig.json",
"publishConfig": { "publishConfig": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/types", "name": "@docusaurus/types",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Common types for Docusaurus packages.", "description": "Common types for Docusaurus packages.",
"types": "./src/index.d.ts", "types": "./src/index.d.ts",
"publishConfig": { "publishConfig": {

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/utils-common", "name": "@docusaurus/utils-common",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Common (Node/Browser) utility functions for Docusaurus packages.", "description": "Common (Node/Browser) utility functions for Docusaurus packages.",
"main": "./lib/index.js", "main": "./lib/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/utils-validation", "name": "@docusaurus/utils-validation",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Node validation utility functions for Docusaurus packages.", "description": "Node validation utility functions for Docusaurus packages.",
"main": "./lib/index.js", "main": "./lib/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
@ -18,8 +18,8 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"joi": "^17.9.2", "joi": "^17.9.2",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"tslib": "^2.6.0" "tslib": "^2.6.0"

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/utils", "name": "@docusaurus/utils",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Node utility functions for Docusaurus packages.", "description": "Node utility functions for Docusaurus packages.",
"main": "./lib/index.js", "main": "./lib/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
@ -18,7 +18,7 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@svgr/webpack": "^6.5.1", "@svgr/webpack": "^6.5.1",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
@ -40,7 +40,7 @@
"node": ">=18.0" "node": ">=18.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@types/dedent": "^0.7.0", "@types/dedent": "^0.7.0",
"@types/github-slugger": "^1.3.0", "@types/github-slugger": "^1.3.0",
"@types/micromatch": "^4.0.2", "@types/micromatch": "^4.0.2",

View file

@ -1,7 +1,7 @@
{ {
"name": "@docusaurus/core", "name": "@docusaurus/core",
"description": "Easy to Maintain Open Source Documentation Websites", "description": "Easy to Maintain Open Source Documentation Websites",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"license": "MIT", "license": "MIT",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
@ -43,13 +43,13 @@
"@babel/runtime": "^7.22.6", "@babel/runtime": "^7.22.6",
"@babel/runtime-corejs3": "^7.22.6", "@babel/runtime-corejs3": "^7.22.6",
"@babel/traverse": "^7.22.8", "@babel/traverse": "^7.22.8",
"@docusaurus/cssnano-preset": "3.0.0-beta.0", "@docusaurus/cssnano-preset": "3.0.0-rc.0",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/mdx-loader": "3.0.0-beta.0", "@docusaurus/mdx-loader": "3.0.0-rc.0",
"@docusaurus/react-loadable": "5.5.2", "@docusaurus/react-loadable": "5.5.2",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-common": "3.0.0-beta.0", "@docusaurus/utils-common": "3.0.0-rc.0",
"@docusaurus/utils-validation": "3.0.0-beta.0", "@docusaurus/utils-validation": "3.0.0-rc.0",
"@slorber/static-site-generator-webpack-plugin": "^4.0.7", "@slorber/static-site-generator-webpack-plugin": "^4.0.7",
"@svgr/webpack": "^6.5.1", "@svgr/webpack": "^6.5.1",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
@ -105,8 +105,8 @@
"webpackbar": "^5.0.2" "webpackbar": "^5.0.2"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0-beta.0", "@docusaurus/module-type-aliases": "3.0.0-rc.0",
"@docusaurus/types": "3.0.0-beta.0", "@docusaurus/types": "3.0.0-rc.0",
"@types/detect-port": "^1.3.3", "@types/detect-port": "^1.3.3",
"@types/react-dom": "^18.2.7", "@types/react-dom": "^18.2.7",
"@types/react-router-config": "^5.0.7", "@types/react-router-config": "^5.0.7",

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/eslint-plugin", "name": "@docusaurus/eslint-plugin",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "ESLint plugin to enforce best Docusaurus practices.", "description": "ESLint plugin to enforce best Docusaurus practices.",
"main": "lib/index.js", "main": "lib/index.js",
"keywords": [ "keywords": [

View file

@ -1,6 +1,6 @@
{ {
"name": "@docusaurus/lqip-loader", "name": "@docusaurus/lqip-loader",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Low Quality Image Placeholders (LQIP) loader for webpack.", "description": "Low Quality Image Placeholders (LQIP) loader for webpack.",
"main": "lib/index.js", "main": "lib/index.js",
"publishConfig": { "publishConfig": {
@ -17,7 +17,7 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"sharp": "^0.32.3", "sharp": "^0.32.3",

View file

@ -1,6 +1,6 @@
{ {
"name": "stylelint-copyright", "name": "stylelint-copyright",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"description": "Stylelint plugin to check CSS files for a copyright header.", "description": "Stylelint plugin to check CSS files for a copyright header.",
"main": "lib/index.js", "main": "lib/index.js",
"license": "MIT", "license": "MIT",

View file

@ -49,7 +49,7 @@ MDX v2 is much better, but also comes with changes that probably require you to
Upgrading MDX comes with all the breaking changes documented on the [MDX v2 release blog post](https://mdxjs.com/blog/v2/). The [MDX v2 migration guide](https://mdxjs.com/migrating/v2/) has a section on how to [update MDX files](https://mdxjs.com/migrating/v2/#update-mdx-files) that will be particularly relevant to us. Also make sure to read the [Troubleshooting MDX](https://mdxjs.com/docs/troubleshooting-mdx/) page that can help you interpret common MDX error messages. Upgrading MDX comes with all the breaking changes documented on the [MDX v2 release blog post](https://mdxjs.com/blog/v2/). The [MDX v2 migration guide](https://mdxjs.com/migrating/v2/) has a section on how to [update MDX files](https://mdxjs.com/migrating/v2/#update-mdx-files) that will be particularly relevant to us. Also make sure to read the [Troubleshooting MDX](https://mdxjs.com/docs/troubleshooting-mdx/) page that can help you interpret common MDX error messages.
Make sure to also read our updated [**MDX and React**](/docs/3.0.0-beta.0/markdown-features/react) documentation page. Make sure to also read our updated [**MDX and React**](/docs/3.0.0-rc.0/markdown-features/react) documentation page.
:::tip Ask for help :::tip Ask for help
@ -214,14 +214,14 @@ http://localhost:3000
#### Lower-case MDXComponent mapping #### Lower-case MDXComponent mapping
For users providing a [custom `MDXComponent`mapping](/docs/3.0.0-beta.0/markdown-features/react#mdx-component-scope), components are now "sandboxed": For users providing a [custom `MDXComponent`mapping](/docs/3.0.0-rc.0/markdown-features/react#mdx-component-scope), components are now "sandboxed":
- a `MDXComponent` mapping for `h1` only gets used for `# hi` but not for `<h1>hi</h1>` - a `MDXComponent` mapping for `h1` only gets used for `# hi` but not for `<h1>hi</h1>`
- a **lower-cased** custom element name will not be substituted by its respective `MDXComponent` component anymore - a **lower-cased** custom element name will not be substituted by its respective `MDXComponent` component anymore
:::danger visual difference :::danger visual difference
Your [`MDXComponent` component mapping](/docs/3.0.0-beta.0/markdown-features/react#mdx-component-scope) might not be applied as before, and your custom components might no longer be used. Your [`MDXComponent` component mapping](/docs/3.0.0-rc.0/markdown-features/react#mdx-component-scope) might not be applied as before, and your custom components might no longer be used.
::: :::

View file

@ -292,7 +292,7 @@ For users providing a [custom `MDXComponent`mapping](../guides/markdown-features
:::danger visual difference :::danger visual difference
Your [`MDXComponent` component mapping](/docs/3.0.0-beta.0/markdown-features/react#mdx-component-scope) might not be applied as before, and your custom components might no longer be used. Your [`MDXComponent` component mapping](/docs/3.0.0-rc.0/markdown-features/react#mdx-component-scope) might not be applied as before, and your custom components might no longer be used.
::: :::

View file

@ -1,6 +1,6 @@
{ {
"name": "website", "name": "website",
"version": "3.0.0-beta.0", "version": "3.0.0-rc.0",
"private": true, "private": true,
"scripts": { "scripts": {
"docusaurus": "docusaurus", "docusaurus": "docusaurus",
@ -36,19 +36,19 @@
"dependencies": { "dependencies": {
"@crowdin/cli": "^3.13.0", "@crowdin/cli": "^3.13.0",
"@crowdin/crowdin-api-client": "^1.23.3", "@crowdin/crowdin-api-client": "^1.23.3",
"@docusaurus/core": "3.0.0-beta.0", "@docusaurus/core": "3.0.0-rc.0",
"@docusaurus/logger": "3.0.0-beta.0", "@docusaurus/logger": "3.0.0-rc.0",
"@docusaurus/plugin-client-redirects": "3.0.0-beta.0", "@docusaurus/plugin-client-redirects": "3.0.0-rc.0",
"@docusaurus/plugin-ideal-image": "3.0.0-beta.0", "@docusaurus/plugin-ideal-image": "3.0.0-rc.0",
"@docusaurus/plugin-pwa": "3.0.0-beta.0", "@docusaurus/plugin-pwa": "3.0.0-rc.0",
"@docusaurus/preset-classic": "3.0.0-beta.0", "@docusaurus/preset-classic": "3.0.0-rc.0",
"@docusaurus/remark-plugin-npm2yarn": "3.0.0-beta.0", "@docusaurus/remark-plugin-npm2yarn": "3.0.0-rc.0",
"@docusaurus/theme-classic": "3.0.0-beta.0", "@docusaurus/theme-classic": "3.0.0-rc.0",
"@docusaurus/theme-common": "3.0.0-beta.0", "@docusaurus/theme-common": "3.0.0-rc.0",
"@docusaurus/theme-live-codeblock": "3.0.0-beta.0", "@docusaurus/theme-live-codeblock": "3.0.0-rc.0",
"@docusaurus/theme-mermaid": "3.0.0-beta.0", "@docusaurus/theme-mermaid": "3.0.0-rc.0",
"@docusaurus/utils": "3.0.0-beta.0", "@docusaurus/utils": "3.0.0-rc.0",
"@docusaurus/utils-common": "3.0.0-beta.0", "@docusaurus/utils-common": "3.0.0-rc.0",
"@popperjs/core": "^2.11.8", "@popperjs/core": "^2.11.8",
"@swc/core": "1.2.197", "@swc/core": "1.2.197",
"clsx": "^1.2.1", "clsx": "^1.2.1",
@ -83,8 +83,8 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/eslint-plugin": "3.0.0-beta.0", "@docusaurus/eslint-plugin": "3.0.0-rc.0",
"@docusaurus/tsconfig": "3.0.0-beta.0", "@docusaurus/tsconfig": "3.0.0-rc.0",
"@types/color": "^3.0.4", "@types/color": "^3.0.4",
"@types/jest": "^29.5.3", "@types/jest": "^29.5.3",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",

View file

@ -20,7 +20,7 @@ This diagram shows how Docusaurus works to build your app. Plugins each collect
Although you (either plugin authors or site creators) are writing JavaScript all the time, bear in mind that the JS is actually run in different environments: Although you (either plugin authors or site creators) are writing JavaScript all the time, bear in mind that the JS is actually run in different environments:
- All plugin lifecycle methods are run in Node. Therefore, until we support ES Modules in our codebase, plugin source code must be provided as CommonJS that can be `require`'d. - All plugin lifecycle methods are run in Node. Therefore, until we support ES Modules in our codebase, plugin source code must be provided as ES modules that can be imported, or CommonJS that can be `require`'d.
- The theme code is built with Webpack. They can be provided as ESM—following React conventions. - The theme code is built with Webpack. They can be provided as ESM—following React conventions.
Plugin code and theme code never directly import each other: they only communicate through protocols (in our case, through JSON temp files and calls to `addRoute`). A useful mental model is to imagine that the plugins are not written in JavaScript, but in another language like Rust. The only way to interact with plugins for the user is through `docusaurus.config.js`, which itself is run in Node (hence you can use `require` and pass callbacks as plugin options). Plugin code and theme code never directly import each other: they only communicate through protocols (in our case, through JSON temp files and calls to `addRoute`). A useful mental model is to imagine that the plugins are not written in JavaScript, but in another language like Rust. The only way to interact with plugins for the user is through `docusaurus.config.js`, which itself is run in Node (hence you can use `require` and pass callbacks as plugin options).

View file

@ -1,6 +1,6 @@
# Plugins # Plugins
Plugins are the building blocks of features in a Docusaurus 2 site. Each plugin handles its own individual feature. Plugins may work and be distributed as part of a bundle via presets. Plugins are the building blocks of features in a Docusaurus site. Each plugin handles its own individual feature. Plugins may work and be distributed as part of a bundle via presets.
## Creating plugins {#creating-plugins} ## Creating plugins {#creating-plugins}
@ -11,7 +11,7 @@ A plugin is a function that takes two parameters: `context` and `options`. It re
You can use a plugin as a function directly included in the Docusaurus config file: You can use a plugin as a function directly included in the Docusaurus config file:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
plugins: [ plugins: [
// highlight-start // highlight-start
@ -38,7 +38,7 @@ module.exports = {
You can use a plugin as a module path referencing a separate file or npm package: You can use a plugin as a module path referencing a separate file or npm package:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
plugins: [ plugins: [
// without options: // without options:
@ -52,7 +52,7 @@ module.exports = {
Then in the folder `my-plugin`, you can create an `index.js` such as this: Then in the folder `my-plugin`, you can create an `index.js` such as this:
```js title="my-plugin/index.js" ```js title="my-plugin/index.js"
module.exports = async function myPlugin(context, options) { export default async function myPlugin(context, options) {
// ... // ...
return { return {
name: 'my-plugin', name: 'my-plugin',
@ -64,7 +64,7 @@ module.exports = async function myPlugin(context, options) {
}, },
/* other lifecycle API */ /* other lifecycle API */
}; };
}; }
``` ```
--- ---
@ -99,7 +99,7 @@ This is a contrived example: in practice, `@docusaurus/theme-classic` provides t
::: :::
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// highlight-next-line // highlight-next-line
themes: ['theme-blog'], themes: ['theme-blog'],
plugins: ['plugin-content-blog'], plugins: ['plugin-content-blog'],
@ -109,7 +109,7 @@ module.exports = {
And if you want to use Bootstrap styling, you can swap out the theme with `theme-blog-bootstrap` (another fictitious non-existing theme): And if you want to use Bootstrap styling, you can swap out the theme with `theme-blog-bootstrap` (another fictitious non-existing theme):
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// highlight-next-line // highlight-next-line
themes: ['theme-blog-bootstrap'], themes: ['theme-blog-bootstrap'],
plugins: ['plugin-content-blog'], plugins: ['plugin-content-blog'],

View file

@ -18,12 +18,20 @@ Refer to the Getting Started [**Configuration**](../configuration.mdx) for examp
`docusaurus.config.js` contains configurations for your site and is placed in the root directory of your site. `docusaurus.config.js` contains configurations for your site and is placed in the root directory of your site.
This file is run in Node.js using the [**CommonJS**](https://flaviocopes.com/commonjs/) module system, and should export a site configuration object, or a function that creates it. This file is run in Node.js and should export a site configuration object, or a function that creates it.
The `docusaurus.config.js` file supports:
- [**ES Modules**](https://flaviocopes.com/es-modules/)
- [**CommonJS**](https://flaviocopes.com/commonjs/)
- [**TypeScript**](../typescript-support.mdx#typing-config)
hey
Examples: Examples:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
title: 'Docusaurus', title: 'Docusaurus',
url: 'https://docusaurus.io', url: 'https://docusaurus.io',
// your site config ... // your site config ...
@ -31,13 +39,13 @@ module.exports = {
``` ```
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = async function createConfigAsync() { export default async function createConfigAsync() {
return { return {
title: 'Docusaurus', title: 'Docusaurus',
url: 'https://docusaurus.io', url: 'https://docusaurus.io',
// your site config ... // your site config ...
}; };
}; }
``` ```
:::tip :::tip
@ -55,7 +63,7 @@ Refer to [**Syntax to declare `docusaurus.config.js`**](../configuration.mdx#syn
Title for your website. Will be used in metadata and as browser tab title. Title for your website. Will be used in metadata and as browser tab title.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
title: 'Docusaurus', title: 'Docusaurus',
}; };
``` ```
@ -67,7 +75,7 @@ module.exports = {
URL for your website. This can also be considered the top-level hostname. For example, `https://facebook.github.io` is the URL of https://facebook.github.io/metro/, and `https://docusaurus.io` is the URL for https://docusaurus.io. This field is related to the [`baseUrl`](#baseUrl) field. URL for your website. This can also be considered the top-level hostname. For example, `https://facebook.github.io` is the URL of https://facebook.github.io/metro/, and `https://docusaurus.io` is the URL for https://docusaurus.io. This field is related to the [`baseUrl`](#baseUrl) field.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
url: 'https://docusaurus.io', url: 'https://docusaurus.io',
}; };
``` ```
@ -79,7 +87,7 @@ module.exports = {
Base URL for your site. Can be considered as the path after the host. For example, `/metro/` is the base URL of https://facebook.github.io/metro/. For URLs that have no path, the baseUrl should be set to `/`. This field is related to the [`url`](#url) field. Always has both leading and trailing slash. Base URL for your site. Can be considered as the path after the host. For example, `/metro/` is the base URL of https://facebook.github.io/metro/. For URLs that have no path, the baseUrl should be set to `/`. This field is related to the [`url`](#url) field. Always has both leading and trailing slash.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
baseUrl: '/', baseUrl: '/',
}; };
``` ```
@ -93,7 +101,7 @@ module.exports = {
Path to your site favicon; must be a URL that can be used in link's href. For example, if your favicon is in `static/img/favicon.ico`: Path to your site favicon; must be a URL that can be used in link's href. For example, if your favicon is in `static/img/favicon.ico`:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
favicon: '/img/favicon.ico', favicon: '/img/favicon.ico',
}; };
``` ```
@ -127,7 +135,7 @@ Example:
{/* cSpell:ignore فارسی */} {/* cSpell:ignore فارسی */}
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
i18n: { i18n: {
defaultLocale: 'en', defaultLocale: 'en',
locales: ['en', 'fa'], locales: ['en', 'fa'],
@ -171,7 +179,7 @@ This option adds `<meta name="robots" content="noindex, nofollow">` to every pag
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
noIndex: true, // Defaults to `false` noIndex: true, // Defaults to `false`
}; };
``` ```
@ -213,7 +221,7 @@ By default, it displays a warning after you run `yarn start` or `yarn build`.
The tagline for your website. The tagline for your website.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
tagline: tagline:
'Docusaurus makes it easy to maintain Open Source documentation websites.', 'Docusaurus makes it easy to maintain Open Source documentation websites.',
}; };
@ -226,7 +234,7 @@ module.exports = {
The GitHub user or organization that owns the repository. You don't need this if you are not using the `docusaurus deploy` command. The GitHub user or organization that owns the repository. You don't need this if you are not using the `docusaurus deploy` command.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// Docusaurus' organization is facebook // Docusaurus' organization is facebook
organizationName: 'facebook', organizationName: 'facebook',
}; };
@ -239,7 +247,7 @@ module.exports = {
The name of the GitHub repository. You don't need this if you are not using the `docusaurus deploy` command. The name of the GitHub repository. You don't need this if you are not using the `docusaurus deploy` command.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
projectName: 'docusaurus', projectName: 'docusaurus',
}; };
``` ```
@ -251,7 +259,7 @@ module.exports = {
The name of the branch to deploy the static files to. You don't need this if you are not using the `docusaurus deploy` command. The name of the branch to deploy the static files to. You don't need this if you are not using the `docusaurus deploy` command.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
deploymentBranch: 'gh-pages', deploymentBranch: 'gh-pages',
}; };
``` ```
@ -263,7 +271,7 @@ module.exports = {
The hostname of your server. Useful if you are using GitHub Enterprise. You don't need this if you are not using the `docusaurus deploy` command. The hostname of your server. Useful if you are using GitHub Enterprise. You don't need this if you are not using the `docusaurus deploy` command.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
githubHost: 'github.com', githubHost: 'github.com',
}; };
``` ```
@ -275,7 +283,7 @@ module.exports = {
The port of your server. Useful if you are using GitHub Enterprise. You don't need this if you are not using the `docusaurus deploy` command. The port of your server. Useful if you are using GitHub Enterprise. You don't need this if you are not using the `docusaurus deploy` command.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
githubPort: '22', githubPort: '22',
}; };
``` ```
@ -289,7 +297,7 @@ The [theme configuration](./themes/theme-configuration.mdx) object to customize
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
docs: { docs: {
sidebar: { sidebar: {
@ -358,7 +366,7 @@ type PluginConfig = string | [string, any] | PluginModule | [PluginModule, any];
See [plugin method references](./plugin-methods/README.mdx) for the shape of a `PluginModule`. See [plugin method references](./plugin-methods/README.mdx) for the shape of a `PluginModule`.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
'docusaurus-plugin-awesome', 'docusaurus-plugin-awesome',
['docusuarus-plugin-confetti', {fancy: false}], ['docusuarus-plugin-confetti', {fancy: false}],
@ -376,7 +384,7 @@ module.exports = {
- Type: `PluginConfig[]` - Type: `PluginConfig[]`
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themes: ['@docusaurus/theme-classic'], themes: ['@docusaurus/theme-classic'],
}; };
``` ```
@ -390,7 +398,7 @@ type PresetConfig = string | [string, any];
``` ```
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [], presets: [],
}; };
``` ```
@ -426,7 +434,7 @@ type MarkdownConfig = {
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
markdown: { markdown: {
format: 'mdx', format: 'mdx',
mermaid: true, mermaid: true,
@ -464,7 +472,7 @@ Docusaurus guards `docusaurus.config.js` from unknown fields. To add a custom fi
- Type: `Object` - Type: `Object`
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
customFields: { customFields: {
admin: 'endi', admin: 'endi',
superman: 'lol', superman: 'lol',
@ -487,7 +495,7 @@ An array of paths, relative to the site's directory or absolute. Files under the
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
staticDirectories: ['static'], staticDirectories: ['static'],
}; };
``` ```
@ -501,7 +509,7 @@ An array of tags that will be inserted in the HTML `<head>`. The values must be
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
headTags: [ headTags: [
{ {
tagName: 'link', tagName: 'link',
@ -527,7 +535,7 @@ Note that `<script>` added here are render-blocking, so you might want to add `a
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
scripts: [ scripts: [
// String format. // String format.
'https://docusaurus.io/script.js', 'https://docusaurus.io/script.js',
@ -549,7 +557,7 @@ An array of CSS sources to load. The values can be either strings or plain objec
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
stylesheets: [ stylesheets: [
// String format. // String format.
'https://docusaurus.io/style.css', 'https://docusaurus.io/style.css',
@ -574,11 +582,8 @@ An array of [client modules](../advanced/client.mdx#client-modules) to load glob
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
clientModules: [ clientModules: ['./mySiteGlobalJs.js', './mySiteGlobalCss.css'],
require.resolve('./mySiteGlobalJs.js'),
require.resolve('./mySiteGlobalCss.css'),
],
}; };
``` ```
@ -591,7 +596,7 @@ An HTML template written in [Eta's syntax](https://eta.js.org/docs/syntax#syntax
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
ssrTemplate: `<!DOCTYPE html> ssrTemplate: `<!DOCTYPE html>
<html <%~ it.htmlAttributes %>> <html <%~ it.htmlAttributes %>>
<head> <head>
@ -631,7 +636,7 @@ Will be used as title delimiter in the generated `<title>` tag.
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
titleDelimiter: '🦖', // Defaults to `|` titleDelimiter: '🦖', // Defaults to `|`
}; };
``` ```
@ -645,7 +650,7 @@ When enabled, will show a banner in case your site can't load its CSS or JavaScr
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
baseUrlIssueBanner: true, // Defaults to `true` baseUrlIssueBanner: true, // Defaults to `true`
}; };
``` ```

View file

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Before After
Before After

View file

@ -47,7 +47,7 @@ Here's a mental model for a presumptuous plugin implementation.
// A JavaScript function that returns an object. // A JavaScript function that returns an object.
// `context` is provided by Docusaurus. Example: siteConfig can be accessed from context. // `context` is provided by Docusaurus. Example: siteConfig can be accessed from context.
// `opts` is the user-defined options. // `opts` is the user-defined options.
async function myPlugin(context, opts) { export default async function myPlugin(context, opts) {
return { return {
// A compulsory field used as the namespace for directories to cache // A compulsory field used as the namespace for directories to cache
// the intermediate data for each plugin. // the intermediate data for each plugin.
@ -132,15 +132,13 @@ async function myPlugin(context, opts) {
}; };
} }
myPlugin.validateOptions = ({options, validate}) => { export function validateOptions({options, validate}) {
const validatedOptions = validate(myValidationSchema, options); const validatedOptions = validate(myValidationSchema, options);
return validatedOptions; return validatedOptions;
}; }
myPlugin.validateThemeConfig = ({themeConfig, validate}) => { export function validateThemeConfig({themeConfig, validate}) {
const validatedThemeConfig = validate(myValidationSchema, options); const validatedThemeConfig = validate(myValidationSchema, options);
return validatedThemeConfig; return validatedThemeConfig;
}; }
module.exports = myPlugin;
``` ```

View file

@ -15,8 +15,9 @@ Use this for files that are consumed server-side, because theme files are automa
Example: Example:
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
const path = require('path'); import path from 'path';
module.exports = function (context, options) {
export default function (context, options) {
return { return {
name: 'docusaurus-plugin', name: 'docusaurus-plugin',
// highlight-start // highlight-start
@ -26,7 +27,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `extendCli(cli)` {#extendCli} ## `extendCli(cli)` {#extendCli}
@ -42,7 +43,7 @@ The commander version matters! We use commander v5, and make sure you are referr
Example: Example:
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'docusaurus-plugin', name: 'docusaurus-plugin',
// highlight-start // highlight-start
@ -56,7 +57,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `getThemePath()` {#getThemePath} ## `getThemePath()` {#getThemePath}
@ -66,9 +67,7 @@ Returns the path to the directory where the theme components can be found. When
For example, your `getThemePath` can be: For example, your `getThemePath` can be:
```js title="my-theme/src/index.js" ```js title="my-theme/src/index.js"
const path = require('path'); export default function (context, options) {
module.exports = function (context, options) {
return { return {
name: 'my-theme', name: 'my-theme',
// highlight-start // highlight-start
@ -77,7 +76,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `getTypeScriptThemePath()` {#getTypeScriptThemePath} ## `getTypeScriptThemePath()` {#getTypeScriptThemePath}
@ -95,9 +94,7 @@ You should also format these files with Prettier. Remember—JS files can and wi
Example: Example:
```js title="my-theme/src/index.js" ```js title="my-theme/src/index.js"
const path = require('path'); export default function (context, options) {
module.exports = function (context, options) {
return { return {
name: 'my-theme', name: 'my-theme',
// highlight-start // highlight-start
@ -111,7 +108,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `getSwizzleComponentList()` {#getSwizzleComponentList} ## `getSwizzleComponentList()` {#getSwizzleComponentList}
@ -121,15 +118,15 @@ module.exports = function (context, options) {
Returns a list of stable components that are considered safe for swizzling. These components will be swizzlable without `--danger`. All components are considered unstable by default. If an empty array is returned, all components are considered unstable. If `undefined` is returned, all components are considered stable. Returns a list of stable components that are considered safe for swizzling. These components will be swizzlable without `--danger`. All components are considered unstable by default. If an empty array is returned, all components are considered unstable. If `undefined` is returned, all components are considered stable.
```js title="my-theme/src/index.js" ```js title="my-theme/src/index.js"
const swizzleAllowedComponents = [ export function getSwizzleComponentList() {
'CodeBlock', return [
'DocSidebar', 'CodeBlock',
'Footer', 'DocSidebar',
'NotFound', 'Footer',
'SearchBar', 'NotFound',
'hooks/useTheme', 'SearchBar',
'prism-include-languages', 'hooks/useTheme',
]; 'prism-include-languages',
];
myTheme.getSwizzleComponentList = () => swizzleAllowedComponents; }
``` ```

View file

@ -19,8 +19,8 @@ These files will be written by the [`write-translations` CLI](../../cli.mdx#docu
Example: Example:
```js ```js title="my-plugin.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'my-plugin', name: 'my-plugin',
// highlight-start // highlight-start
@ -40,7 +40,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `translateContent({content,translationFiles})` {#translateContent} ## `translateContent({content,translationFiles})` {#translateContent}
@ -53,8 +53,8 @@ The `contentLoaded()` lifecycle will be called with the localized plugin content
Example: Example:
```js ```js title="my-plugin.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'my-plugin', name: 'my-plugin',
// highlight-start // highlight-start
@ -69,7 +69,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `translateThemeConfig({themeConfig,translationFiles})` {#translateThemeConfig} ## `translateThemeConfig({themeConfig,translationFiles})` {#translateThemeConfig}
@ -80,8 +80,8 @@ Returns the localized `themeConfig`.
Example: Example:
```js ```js title="my-plugin.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'my-theme', name: 'my-theme',
// highlight-start // highlight-start
@ -96,7 +96,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `async getDefaultCodeTranslationMessages()` {#getDefaultCodeTranslationMessages} ## `async getDefaultCodeTranslationMessages()` {#getDefaultCodeTranslationMessages}
@ -107,8 +107,8 @@ It should return messages in `Record<string, string>`, where keys are translatio
Example: Example:
```js ```js title="my-plugin.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'my-theme', name: 'my-theme',
// highlight-start // highlight-start
@ -117,5 +117,5 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```

View file

@ -14,7 +14,7 @@ Plugins should use this lifecycle to fetch from data sources (filesystem, remote
For example, this plugin below returns a random integer between 1 and 10 as content. For example, this plugin below returns a random integer between 1 and 10 as content.
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'docusaurus-plugin', name: 'docusaurus-plugin',
// highlight-start // highlight-start
@ -23,7 +23,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `async contentLoaded({content, actions})` {#contentLoaded} ## `async contentLoaded({content, actions})` {#contentLoaded}
@ -183,7 +183,7 @@ You may use them to return your webpack configuration conditionally.
For example, this plugin below modify the webpack config to transpile `.foo` files. For example, this plugin below modify the webpack config to transpile `.foo` files.
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'custom-docusaurus-plugin', name: 'custom-docusaurus-plugin',
// highlight-start // highlight-start
@ -202,7 +202,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
### `content` {#content-1} ### `content` {#content-1}
@ -216,7 +216,7 @@ We merge the Webpack configuration parts of plugins into the global Webpack conf
It is possible to specify the merge strategy. For example, if you want a webpack rule to be prepended instead of appended: It is possible to specify the merge strategy. For example, if you want a webpack rule to be prepended instead of appended:
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'custom-docusaurus-plugin', name: 'custom-docusaurus-plugin',
configureWebpack(config, isServer, utils) { configureWebpack(config, isServer, utils) {
@ -228,7 +228,7 @@ module.exports = function (context, options) {
}; };
}, },
}; };
}; }
``` ```
Read the [webpack-merge strategy doc](https://github.com/survivejs/webpack-merge#merging-with-strategies) for more details. Read the [webpack-merge strategy doc](https://github.com/survivejs/webpack-merge#merging-with-strategies) for more details.
@ -238,7 +238,7 @@ Read the [webpack-merge strategy doc](https://github.com/survivejs/webpack-merge
The dev server can be configured through returning a `devServer` field. The dev server can be configured through returning a `devServer` field.
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'custom-docusaurus-plugin', name: 'custom-docusaurus-plugin',
configureWebpack(config, isServer, utils) { configureWebpack(config, isServer, utils) {
@ -251,7 +251,7 @@ module.exports = function (context, options) {
}; };
}, },
}; };
}; }
``` ```
## `configurePostCss(options)` {#configurePostCss} ## `configurePostCss(options)` {#configurePostCss}
@ -272,7 +272,7 @@ const postcssOptions = {
Example: Example:
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'docusaurus-plugin', name: 'docusaurus-plugin',
// highlight-start // highlight-start
@ -283,7 +283,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `postBuild(props)` {#postBuild} ## `postBuild(props)` {#postBuild}
@ -309,7 +309,7 @@ interface Props {
Example: Example:
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'docusaurus-plugin', name: 'docusaurus-plugin',
// highlight-start // highlight-start
@ -321,7 +321,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
## `injectHtmlTags({content})` {#injectHtmlTags} ## `injectHtmlTags({content})` {#injectHtmlTags}
@ -361,7 +361,7 @@ type HtmlTagObject = {
Example: Example:
```js title="docusaurus-plugin/src/index.js" ```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) { export default function (context, options) {
return { return {
name: 'docusaurus-plugin', name: 'docusaurus-plugin',
loadContent: async () => { loadContent: async () => {
@ -394,7 +394,7 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```
Tags will be added as follows: Tags will be added as follows:
@ -410,9 +410,7 @@ Returns an array of paths to the [client modules](../../advanced/client.mdx#clie
As an example, to make your theme load a `customCss` or `customJs` file path from `options` passed in by the user: As an example, to make your theme load a `customCss` or `customJs` file path from `options` passed in by the user:
```js title="my-theme/src/index.js" ```js title="my-theme/src/index.js"
const path = require('path'); export default function (context, options) {
module.exports = function (context, options) {
const {customCss, customJs} = options || {}; const {customCss, customJs} = options || {};
return { return {
name: 'name-of-my-theme', name: 'name-of-my-theme',
@ -422,5 +420,5 @@ module.exports = function (context, options) {
}, },
// highlight-end // highlight-end
}; };
}; }
``` ```

View file

@ -22,34 +22,14 @@ Returns validated and normalized options for the plugin. This method is called b
[Joi](https://www.npmjs.com/package/joi) is recommended for validation and normalization of options. [Joi](https://www.npmjs.com/package/joi) is recommended for validation and normalization of options.
To avoid mixing Joi versions, use `const {Joi} = require("@docusaurus/utils-validation")` To avoid mixing Joi versions, use `import {Joi} from '@docusaurus/utils-validation'`
::: :::
If you don't use **[Joi](https://www.npmjs.com/package/joi)** for validation you can throw an Error in case of invalid options and return options in case of success. If you don't use **[Joi](https://www.npmjs.com/package/joi)** for validation you can throw an Error in case of invalid options and return options in case of success.
```js title="my-plugin/src/index.js" ```js title="my-plugin/src/index.js"
function myPlugin(context, options) { export default function myPlugin(context, options) {
return {
name: 'docusaurus-plugin',
// rest of methods
};
}
// highlight-start
myPlugin.validateOptions = ({options, validate}) => {
const validatedOptions = validate(myValidationSchema, options);
return validatedOptions;
};
// highlight-end
module.exports = myPlugin;
```
In TypeScript, you can also choose to export this as a separate named export.
```ts title="my-plugin/src/index.ts"
export default function (context, options) {
return { return {
name: 'docusaurus-plugin', name: 'docusaurus-plugin',
// rest of methods // rest of methods
@ -80,34 +60,14 @@ Return validated and normalized configuration for the theme.
[Joi](https://www.npmjs.com/package/joi) is recommended for validation and normalization of theme config. [Joi](https://www.npmjs.com/package/joi) is recommended for validation and normalization of theme config.
To avoid mixing Joi versions, use `const {Joi} = require("@docusaurus/utils-validation")` To avoid mixing Joi versions, use `import {Joi} from '@docusaurus/utils-validation'`
::: :::
If you don't use **[Joi](https://www.npmjs.com/package/joi)** for validation you can throw an Error in case of invalid options. If you don't use **[Joi](https://www.npmjs.com/package/joi)** for validation you can throw an Error in case of invalid options.
```js title="my-theme/src/index.js" ```js title="my-theme/src/index.js"
function myPlugin(context, options) { export default function myPlugin(context, options) {
return {
name: 'docusaurus-plugin',
// rest of methods
};
}
// highlight-start
myPlugin.validateThemeConfig = ({themeConfig, validate}) => {
const validatedThemeConfig = validate(myValidationSchema, options);
return validatedThemeConfig;
};
// highlight-end
module.exports = validateThemeConfig;
```
In TypeScript, you can also choose to export this as a separate named export.
```ts title="my-theme/src/index.ts"
export default function (context, options) {
return { return {
name: 'docusaurus-plugin', name: 'docusaurus-plugin',
// rest of methods // rest of methods

View file

@ -89,7 +89,7 @@ type CreateRedirectsFn = (path: string) => string[] | string | null | undefined;
Here's an example configuration: Here's an example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-client-redirects', '@docusaurus/plugin-client-redirects',

View file

@ -169,7 +169,7 @@ const config = {
blogPostComponent: '@theme/BlogPostPage', blogPostComponent: '@theme/BlogPostPage',
blogTagsListComponent: '@theme/BlogTagsListPage', blogTagsListComponent: '@theme/BlogTagsListPage',
blogTagsPostsComponent: '@theme/BlogTagsPostsPage', blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
remarkPlugins: [require('remark-math')], remarkPlugins: [require('./my-remark-plugin')],
rehypePlugins: [], rehypePlugins: [],
beforeDefaultRemarkPlugins: [], beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [], beforeDefaultRehypePlugins: [],
@ -249,7 +249,7 @@ Example:
```md ```md
--- ---
title: Welcome Docusaurus v2 title: Welcome Docusaurus
authors: authors:
- slorber - slorber
- yangshun - yangshun
@ -258,7 +258,7 @@ authors:
url: https://github.com/JoelMarcey url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png image_url: https://github.com/JoelMarcey.png
tags: [hello, docusaurus-v2] tags: [hello, docusaurus-v2]
description: This is my first post on Docusaurus 2. description: This is my first post on Docusaurus.
image: https://i.imgur.com/mErPwqL.png image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false hide_table_of_contents: false
--- ---

View file

@ -234,7 +234,7 @@ const config = {
}, },
docLayoutComponent: '@theme/DocPage', docLayoutComponent: '@theme/DocPage',
docItemComponent: '@theme/DocItem', docItemComponent: '@theme/DocItem',
remarkPlugins: [require('remark-math')], remarkPlugins: [require('./my-remark-plugin')],
rehypePlugins: [], rehypePlugins: [],
beforeDefaultRemarkPlugins: [], beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [], beforeDefaultRehypePlugins: [],

View file

@ -72,7 +72,7 @@ const config = {
'**/__tests__/**', '**/__tests__/**',
], ],
mdxPageComponent: '@theme/MDXPage', mdxPageComponent: '@theme/MDXPage',
remarkPlugins: [require('remark-math')], remarkPlugins: [require('./my-remark-plugin')],
rehypePlugins: [], rehypePlugins: [],
beforeDefaultRemarkPlugins: [], beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [], beforeDefaultRehypePlugins: [],

View file

@ -21,7 +21,7 @@ If you use the plugin via the classic preset, the preset will **enable the plugi
If you use a standalone plugin, you may need to achieve the same effect by checking the environment: If you use a standalone plugin, you may need to achieve the same effect by checking the environment:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
// highlight-next-line // highlight-next-line
process.env.NODE_ENV === 'production' && '@docusaurus/plugin-debug', process.env.NODE_ENV === 'production' && '@docusaurus/plugin-debug',
@ -75,7 +75,7 @@ Most Docusaurus users configure this plugin through the preset options.
If you use a preset, configure this plugin through the [preset options](../../using-plugins.mdx#docusauruspreset-classic): If you use a preset, configure this plugin through the [preset options](../../using-plugins.mdx#docusauruspreset-classic):
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -96,7 +96,7 @@ module.exports = {
If you are using a standalone plugin, provide options directly to the plugin: If you are using a standalone plugin, provide options directly to the plugin:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// highlight-next-line // highlight-next-line
plugins: ['@docusaurus/plugin-debug'], plugins: ['@docusaurus/plugin-debug'],
}; };

View file

@ -73,7 +73,7 @@ Accepted fields:
Here's an example configuration: Here's an example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-ideal-image', '@docusaurus/plugin-ideal-image',

View file

@ -20,7 +20,7 @@ Create a [PWA manifest](https://web.dev/add-manifest/) at `./static/manifest.jso
Modify `docusaurus.config.js` with a minimal PWA config, like: Modify `docusaurus.config.js` with a minimal PWA config, like:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-pwa', '@docusaurus/plugin-pwa',
@ -148,7 +148,7 @@ The [`standalone` strategy](https://petelepage.com/blog/2019/07/is-my-pwa-instal
- Default: `{}` - Default: `{}`
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-pwa', '@docusaurus/plugin-pwa',
@ -179,7 +179,7 @@ module.exports = {
Array of objects containing `tagName` and key-value pairs for attributes to inject into the `<head>` tag. Technically you can inject any head tag through this, but it's ideally used for tags to make your site PWA compliant. Here's a list of tag to make your app fully compliant: Array of objects containing `tagName` and key-value pairs for attributes to inject into the `<head>` tag. Technically you can inject any head tag through this, but it's ideally used for tags to make your site PWA compliant. Here's a list of tag to make your app fully compliant:
```js ```js
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-pwa', '@docusaurus/plugin-pwa',
@ -288,7 +288,7 @@ The Docusaurus site manifest can serve as an inspiration:
import CodeBlock from '@theme/CodeBlock'; import CodeBlock from '@theme/CodeBlock';
<CodeBlock className="language-json"> <CodeBlock className="language-json">
{JSON.stringify(require("@site/static/manifest.json"),null,2)} {JSON.stringify(require('@site/static/manifest.json'),null,2)}
</CodeBlock> </CodeBlock>
``` ```

View file

@ -58,6 +58,6 @@ Most Docusaurus users configure this plugin through the preset options.
// Plugin Options: @docusaurus/theme-classic // Plugin Options: @docusaurus/theme-classic
const config = { const config = {
customCss: require.resolve('./src/css/custom.css'), customCss: './src/css/custom.css',
}; };
``` ```

View file

@ -38,7 +38,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// highlight-start // highlight-start
colorMode: { colorMode: {
@ -80,7 +80,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// highlight-next-line // highlight-next-line
image: 'img/docusaurus.png', image: 'img/docusaurus.png',
@ -109,7 +109,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// highlight-next-line // highlight-next-line
metadata: [{name: 'twitter:card', content: 'summary'}], metadata: [{name: 'twitter:card', content: 'summary'}],
@ -142,7 +142,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// highlight-start // highlight-start
announcementBar: { announcementBar: {
@ -209,7 +209,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
title: 'Site Title', title: 'Site Title',
@ -236,7 +236,7 @@ module.exports = {
You can add items to the navbar via `themeConfig.navbar.items`. You can add items to the navbar via `themeConfig.navbar.items`.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
// highlight-start // highlight-start
@ -311,7 +311,7 @@ In addition to the fields above, you can specify other arbitrary attributes that
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -368,7 +368,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -422,7 +422,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -471,7 +471,7 @@ Use this navbar item type if your sidebar is updated often and the order is not
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -490,7 +490,7 @@ module.exports = {
``` ```
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
tutorial: [ tutorial: [
{ {
type: 'autogenerated', type: 'autogenerated',
@ -537,7 +537,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -580,7 +580,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -625,7 +625,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -668,7 +668,7 @@ However, with this special navbar item type, you can change the default location
``` ```
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -704,7 +704,7 @@ You can also render your own HTML markup inside a navbar item using this navbar
``` ```
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [
@ -726,7 +726,7 @@ module.exports = {
You can enable this cool UI feature that automatically hides the navbar when a user starts scrolling down the page, and show it again when the user scrolls up. You can enable this cool UI feature that automatically hides the navbar when a user starts scrolling down the page, and show it again when the user scrolls up.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
// highlight-next-line // highlight-next-line
@ -743,7 +743,7 @@ You can set the static Navbar style without disabling the theme switching abilit
Currently, there are two possible style options: `dark` and `primary` (based on the `--ifm-color-primary` color). You can see the styles preview in the [Infima documentation](https://infima.dev/docs/components/navbar/). Currently, there are two possible style options: `dark` and `primary` (based on the `--ifm-color-primary` color). You can see the styles preview in the [Infima documentation](https://infima.dev/docs/components/navbar/).
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
// highlight-next-line // highlight-next-line
@ -799,12 +799,14 @@ By default, we use [Palenight](https://github.com/FormidableLabs/prism-react-ren
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { import {themes as prismThemes} from 'prism-react-renderer';
export default {
themeConfig: { themeConfig: {
prism: { prism: {
// highlight-start // highlight-start
theme: require('prism-react-renderer/themes/github'), theme: prismThemes.github,
darkTheme: require('prism-react-renderer/themes/dracula'), darkTheme: prismThemes.dracula,
// highlight-end // highlight-end
}, },
}, },
@ -824,7 +826,7 @@ You can set a default language for code blocks if no language is added after the
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
prism: { prism: {
// highlight-next-line // highlight-next-line
@ -858,7 +860,7 @@ Accepted fields:
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// highlight-start // highlight-start
footer: { footer: {
@ -915,7 +917,7 @@ Accepted fields of each `FooterItem`:
Example multi-column configuration: Example multi-column configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
footer: { footer: {
// highlight-start // highlight-start
links: [ links: [
@ -967,7 +969,7 @@ A simple footer just has a list of `FooterItem`s displayed in a row.
Example simple configuration: Example simple configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
footer: { footer: {
// highlight-start // highlight-start
links: [ links: [
@ -1016,7 +1018,7 @@ You can adjust the default table of contents via `themeConfig.tableOfContents`.
Example configuration: Example configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// highlight-start // highlight-start
tableOfContents: { tableOfContents: {

View file

@ -14,7 +14,7 @@ npm install --save @docusaurus/theme-live-codeblock
### Configuration {#configuration} ### Configuration {#configuration}
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: ['@docusaurus/theme-live-codeblock'], plugins: ['@docusaurus/theme-live-codeblock'],
themeConfig: { themeConfig: {
liveCodeBlock: { liveCodeBlock: {

View file

@ -14,7 +14,7 @@ npm install --save @docusaurus/theme-mermaid
## Configuration {#configuration} ## Configuration {#configuration}
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themes: ['@docusaurus/theme-mermaid'], themes: ['@docusaurus/theme-mermaid'],
// In order for Mermaid code blocks in Markdown to work, // In order for Mermaid code blocks in Markdown to work,
// you also need to enable the Remark plugin with this option // you also need to enable the Remark plugin with this option

View file

@ -22,7 +22,7 @@ To set up your site's blog, start by creating a `blog` directory.
Then, add an item link to your blog within `docusaurus.config.js`: Then, add an item link to your blog within `docusaurus.config.js`:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// ... // ...
navbar: { navbar: {
@ -40,12 +40,12 @@ module.exports = {
To publish in the blog, create a Markdown file within the blog directory. To publish in the blog, create a Markdown file within the blog directory.
For example, create a file at `website/blog/2019-09-05-hello-docusaurus-v2.md`: For example, create a file at `website/blog/2019-09-05-hello-docusaurus.md`:
```md title="website/blog/2019-09-05-hello-docusaurus-v2.md" ```md title="website/blog/2019-09-05-hello-docusaurus.md"
--- ---
title: Welcome Docusaurus v2 title: Welcome Docusaurus
description: This is my first post on Docusaurus 2. description: This is my first post on Docusaurus.
slug: welcome-docusaurus-v2 slug: welcome-docusaurus-v2
authors: authors:
- name: Joel Marcey - name: Joel Marcey
@ -108,7 +108,7 @@ But anything from here on down will not be.
By default, 10 posts are shown on each blog list page, but you can control pagination with the `postsPerPage` option in the plugin configuration. If you set `postsPerPage: 'ALL'`, pagination will be disabled and all posts will be displayed on the first page. You can also add a meta description to the blog list page for better SEO: By default, 10 posts are shown on each blog list page, but you can control pagination with the `postsPerPage` option in the plugin configuration. If you set `postsPerPage: 'ALL'`, pagination will be disabled and all posts will be displayed on the first page. You can also add a meta description to the blog list page for better SEO:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
presets: [ presets: [
[ [
@ -134,7 +134,7 @@ The blog sidebar displays recent blog posts. The default number of items shown i
You can also alter the sidebar heading text with the `blogSidebarTitle` option. For example, if you have set `blogSidebarCount: 'ALL'`, instead of the default "Recent posts", you may rather make it say "All posts": You can also alter the sidebar heading text with the `blogSidebarTitle` option. For example, if you have set `blogSidebarCount: 'ALL'`, instead of the default "Recent posts", you may rather make it say "All posts":
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -385,7 +385,7 @@ An author, either declared through front matter or through the authors map, need
Docusaurus generates a reading time estimation for each blog post based on word count. We provide an option to customize this. Docusaurus generates a reading time estimation for each blog post based on word count. We provide an option to customize this.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -419,7 +419,7 @@ Use the callback for all your customization needs:
**Disable reading time on one page:** **Disable reading time on one page:**
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -457,7 +457,7 @@ This page will no longer display the reading time stats!
**Pass options to the default reading time function:** **Pass options to the default reading time function:**
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -482,9 +482,9 @@ module.exports = {
**Use a custom implementation of reading time:** **Use a custom implementation of reading time:**
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
const myReadingTime = require('./myReadingTime'); import myReadingTime from './myReadingTime';
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -539,7 +539,7 @@ type BlogOptions = {
Example usage: Example usage:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
presets: [ presets: [
[ [
@ -597,10 +597,10 @@ https://example.com/blog/feed.json
### Blog-only mode {#blog-only-mode} ### Blog-only mode {#blog-only-mode}
You can run your Docusaurus 2 site without a dedicated landing page and instead have your blog's post list page as the index page. Set the `routeBasePath` to be `'/'` to serve the blog through the root route `example.com/` instead of the subroute `example.com/blog/`. You can run your Docusaurus site without a dedicated landing page and instead have your blog's post list page as the index page. Set the `routeBasePath` to be `'/'` to serve the blog through the root route `example.com/` instead of the subroute `example.com/blog/`.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
presets: [ presets: [
[ [
@ -640,7 +640,7 @@ Set the `routeBasePath` to the URL route that you want your second blog to be ac
As documented for [multi-instance plugins](./using-plugins.mdx#multi-instance-plugins-and-plugin-ids), you need to assign a unique ID to the plugins. As documented for [multi-instance plugins](./using-plugins.mdx#multi-instance-plugins-and-plugin-ids), you need to assign a unique ID to the plugins.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
plugins: [ plugins: [
[ [

View file

@ -25,15 +25,28 @@ The `docusaurus.config.js` file is run in Node.js and should export either:
:::info :::info
The `docusaurus.config.js` file only supports the [**CommonJS**](https://flaviocopes.com/commonjs/) module system: The `docusaurus.config.js` file supports:
- **Required:** use `module.exports = /* your config*/` to export your Docusaurus config - [**ES Modules**](https://flaviocopes.com/es-modules/)
- **Optional:** use `require("lib")` to import Node.js packages - [**CommonJS**](https://flaviocopes.com/commonjs/)
- **Optional:** use `await import("lib")` (dynamic import) in an async function to import ESM-Only Node.js packages - [**TypeScript**](./typescript-support.mdx#typing-config)
Constraints:
- **Required:** use `export default /* your config*/` (or `module.exports` to export your Docusaurus config
- **Optional:** use `import Lib from 'lib'` (or `require('lib')`) to import Node.js packages
::: :::
Node.js gives us the ability to declare our Docusaurus configuration in various **equivalent ways**, and all the following config examples lead to the exact same result: Docusaurus gives us the ability to declare its configuration in various **equivalent ways**, and all the following config examples lead to the exact same result:
```js title="docusaurus.config.js"
export default {
title: 'Docusaurus',
url: 'https://docusaurus.io',
// your site config ...
};
```
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { module.exports = {
@ -43,6 +56,16 @@ module.exports = {
}; };
``` ```
```ts title="docusaurus.config.ts"
import type {Config} from '@docusaurus/types';
export default {
title: 'Docusaurus',
url: 'https://docusaurus.io',
// your site config ...
} satisfies Config;
```
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
const config = { const config = {
title: 'Docusaurus', title: 'Docusaurus',
@ -50,27 +73,27 @@ const config = {
// your site config ... // your site config ...
}; };
module.exports = config; export default config;
``` ```
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = function configCreator() { export default function configCreator() {
return { return {
title: 'Docusaurus', title: 'Docusaurus',
url: 'https://docusaurus.io', url: 'https://docusaurus.io',
// your site config ... // your site config ...
}; };
}; }
``` ```
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = async function createConfigAsync() { export default async function createConfigAsync() {
return { return {
title: 'Docusaurus', title: 'Docusaurus',
url: 'https://docusaurus.io', url: 'https://docusaurus.io',
// your site config ... // your site config ...
}; };
}; }
``` ```
:::tip Using ESM-only packages :::tip Using ESM-only packages
@ -78,7 +101,7 @@ module.exports = async function createConfigAsync() {
Using an async config creator can be useful to import ESM-only modules (notably most Remark plugins). It is possible to import such modules thanks to dynamic imports: Using an async config creator can be useful to import ESM-only modules (notably most Remark plugins). It is possible to import such modules thanks to dynamic imports:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = async function createConfigAsync() { export default async function createConfigAsync() {
// Use a dynamic import instead of require('esm-lib') // Use a dynamic import instead of require('esm-lib')
// highlight-next-line // highlight-next-line
const lib = await import('lib'); const lib = await import('lib');
@ -88,7 +111,7 @@ module.exports = async function createConfigAsync() {
url: 'https://docusaurus.io', url: 'https://docusaurus.io',
// rest of your site config... // rest of your site config...
}; };
}; }
``` ```
::: :::
@ -120,7 +143,7 @@ It is recommended to check the [deployment docs](deployment.mdx) for more inform
List the [themes](./using-plugins.mdx#using-themes), [plugins](./using-plugins.mdx), and [presets](./using-plugins.mdx#using-presets) for your site in the `themes`, `plugins`, and `presets` fields, respectively. These are typically npm packages: List the [themes](./using-plugins.mdx#using-themes), [plugins](./using-plugins.mdx), and [presets](./using-plugins.mdx#using-presets) for your site in the `themes`, `plugins`, and `presets` fields, respectively. These are typically npm packages:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
plugins: [ plugins: [
'@docusaurus/plugin-content-blog', '@docusaurus/plugin-content-blog',
@ -135,7 +158,7 @@ module.exports = {
Docusaurus supports [**module shorthands**](./using-plugins.mdx#module-shorthands), allowing you to simplify the above configuration as: Docusaurus supports [**module shorthands**](./using-plugins.mdx#module-shorthands), allowing you to simplify the above configuration as:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
plugins: ['content-blog', 'content-pages'], plugins: ['content-blog', 'content-pages'],
themes: ['classic'], themes: ['classic'],
@ -147,9 +170,9 @@ module.exports = {
They can also be loaded from local directories: They can also be loaded from local directories:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
const path = require('path'); import path from 'path';
module.exports = { export default {
// ... // ...
themes: [path.resolve(__dirname, '/path/to/docusaurus-local-theme')], themes: [path.resolve(__dirname, '/path/to/docusaurus-local-theme')],
}; };
@ -158,7 +181,7 @@ module.exports = {
To specify options for a plugin or theme, replace the name of the plugin or theme in the config file with an array containing the name and an options object: To specify options for a plugin or theme, replace the name of the plugin or theme in the config file with an array containing the name and an options object:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
plugins: [ plugins: [
[ [
@ -178,17 +201,17 @@ module.exports = {
To specify options for a plugin or theme that is bundled in a preset, pass the options through the `presets` field. In this example, `docs` refers to `@docusaurus/plugin-content-docs` and `theme` refers to `@docusaurus/theme-classic`. To specify options for a plugin or theme that is bundled in a preset, pass the options through the `presets` field. In this example, `docs` refers to `@docusaurus/plugin-content-docs` and `theme` refers to `@docusaurus/theme-classic`.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
{ {
docs: { docs: {
sidebarPath: require.resolve('./sidebars.js'), sidebarPath: './sidebars.js',
}, },
theme: { theme: {
customCss: [require.resolve('./src/css/custom.css')], customCss: ['./src/css/custom.css'],
}, },
}, },
], ],
@ -211,7 +234,7 @@ Docusaurus guards `docusaurus.config.js` from unknown fields. To add custom fiel
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
// highlight-start // highlight-start
customFields: { customFields: {
@ -255,8 +278,8 @@ If you just want to use those fields on the client side, you could create your o
For new Docusaurus projects, we automatically generated a `babel.config.js` in the project root. For new Docusaurus projects, we automatically generated a `babel.config.js` in the project root.
```js title="babel.config.js" ```js title="babel.config.js"
module.exports = { export default {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], presets: ['@docusaurus/core/lib/babel/preset'],
}; };
``` ```

View file

@ -61,9 +61,9 @@ Putting potentially sensitive information in the environment is common practice.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
// If you are using dotenv (https://www.npmjs.com/package/dotenv) // If you are using dotenv (https://www.npmjs.com/package/dotenv)
require('dotenv').config(); import 'dotenv/config';
module.exports = { export default {
title: '...', title: '...',
url: process.env.URL, // You can use environment variables to control site specifics as well url: process.env.URL, // You can use environment variables to control site specifics as well
// highlight-start // highlight-start
@ -154,10 +154,10 @@ Because we can only provide this content on a best-effort basis only, we have st
## Deploying to Netlify {#deploying-to-netlify} ## Deploying to Netlify {#deploying-to-netlify}
To deploy your Docusaurus 2 sites to [Netlify](https://www.netlify.com/), first make sure the following options are properly configured: To deploy your Docusaurus sites to [Netlify](https://www.netlify.com/), first make sure the following options are properly configured:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// highlight-start // highlight-start
url: 'https://docusaurus-2.netlify.app', // Url to your site with no trailing slash url: 'https://docusaurus-2.netlify.app', // Url to your site with no trailing slash
baseUrl: '/', // Base directory of your site relative to your repo baseUrl: '/', // Base directory of your site relative to your repo
@ -263,7 +263,7 @@ GitHub Pages adds a trailing slash to Docusaurus URLs by default. It is recommen
Example: Example:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
url: 'https://endiliey.github.io', // Your website URL url: 'https://endiliey.github.io', // Your website URL
baseUrl: '/', baseUrl: '/',

View file

@ -32,7 +32,7 @@ const SafeComponent = () => (
``` ```
```mdx-code-block ```mdx-code-block
import ErrorBoundaryTestButton from "@site/src/components/ErrorBoundaryTestButton" import ErrorBoundaryTestButton from '@site/src/components/ErrorBoundaryTestButton'
``` ```
:::tip :::tip

View file

@ -44,7 +44,7 @@ All docs will be served under the subroute `docs/`. But what if **your site only
Assume that you have the following in your configuration: Assume that you have the following in your configuration:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
presets: [ presets: [
[ [
@ -66,7 +66,7 @@ module.exports = {
To enter docs-only mode, change it to like this: To enter docs-only mode, change it to like this:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
// ... // ...
presets: [ presets: [
[ [
@ -115,6 +115,6 @@ example.com/tutorial-basics/... -> generated from `docs/tutorial-basics/...`
:::tip :::tip
There's also a "blog-only mode" for those who only want to use the blog feature of Docusaurus 2. You can use the same method detailed above. Follow the setup instructions on [Blog-only mode](../../blog.mdx#blog-only-mode). There's also a "blog-only mode" for those who only want to use the blog feature of Docusaurus. You can use the same method detailed above. Follow the setup instructions on [Blog-only mode](../../blog.mdx#blog-only-mode).
::: :::

View file

@ -64,7 +64,7 @@ In this case, you should use the same plugin twice in your site configuration.
When using the preset: When using the preset:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -75,7 +75,7 @@ module.exports = {
// highlight-end // highlight-end
path: 'product', path: 'product',
routeBasePath: 'product', routeBasePath: 'product',
sidebarPath: require.resolve('./sidebarsProduct.js'), sidebarPath: './sidebarsProduct.js',
// ... other options // ... other options
}, },
}, },
@ -90,7 +90,7 @@ module.exports = {
// highlight-end // highlight-end
path: 'community', path: 'community',
routeBasePath: 'community', routeBasePath: 'community',
sidebarPath: require.resolve('./sidebarsCommunity.js'), sidebarPath: './sidebarsCommunity.js',
// ... other options // ... other options
}, },
], ],
@ -101,7 +101,7 @@ module.exports = {
When not using the preset: When not using the preset:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-content-docs', '@docusaurus/plugin-content-docs',
@ -111,7 +111,7 @@ module.exports = {
// highlight-end // highlight-end
path: 'product', path: 'product',
routeBasePath: 'product', routeBasePath: 'product',
sidebarPath: require.resolve('./sidebarsProduct.js'), sidebarPath: './sidebarsProduct.js',
// ... other options // ... other options
}, },
], ],
@ -123,7 +123,7 @@ module.exports = {
// highlight-end // highlight-end
path: 'community', path: 'community',
routeBasePath: 'community', routeBasePath: 'community',
sidebarPath: require.resolve('./sidebarsCommunity.js'), sidebarPath: './sidebarsCommunity.js',
// ... other options // ... other options
}, },
], ],
@ -190,7 +190,7 @@ Each docs-related [theme navbar items](../../api/themes/theme-configuration.mdx#
For example, if you want to have one version dropdown for each mobile SDK (iOS and Android), you could do: For example, if you want to have one version dropdown for each mobile SDK (iOS and Android), you could do:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
navbar: { navbar: {
items: [ items: [

View file

@ -21,7 +21,7 @@ type SidebarItemAutogenerated = {
Docusaurus can generate a full sidebar from your docs folder: Docusaurus can generate a full sidebar from your docs folder:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
myAutogeneratedSidebar: [ myAutogeneratedSidebar: [
// highlight-start // highlight-start
{ {
@ -67,7 +67,7 @@ docs
And assume every doc's ID is just its file name. If you define an autogenerated sidebar like this: And assume every doc's ID is just its file name. If you define an autogenerated sidebar like this:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
mySidebar: [ mySidebar: [
'intro', 'intro',
{ {
@ -109,7 +109,7 @@ module.exports = {
It would be resolved as: It would be resolved as:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
mySidebar: [ mySidebar: [
'intro', 'intro',
{ {
@ -175,7 +175,7 @@ A category index document is a document following one of those filename conventi
This is equivalent to using a category with a [doc link](items.mdx#category-doc-link): This is equivalent to using a category with a [doc link](items.mdx#category-doc-link):
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
docs: [ docs: [
// highlight-start // highlight-start
{ {
@ -215,7 +215,7 @@ some-doc
It is possible to opt out any of the category index conventions, or define even more conventions. You can inject your own `isCategoryIndex` matcher through the [`sidebarItemsGenerator`](#customize-the-sidebar-items-generator) callback. For example, you can also pick `intro` as another file name eligible for automatically becoming the category index. It is possible to opt out any of the category index conventions, or define even more conventions. You can inject your own `isCategoryIndex` matcher through the [`sidebarItemsGenerator`](#customize-the-sidebar-items-generator) callback. For example, you can also pick `intro` as another file name eligible for automatically becoming the category index.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-content-docs', '@docusaurus/plugin-content-docs',
@ -247,7 +247,7 @@ module.exports = {
Or choose to not have any category index convention. Or choose to not have any category index convention.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-content-docs', '@docusaurus/plugin-content-docs',
@ -426,7 +426,7 @@ Updating a number prefix can be annoying, as it can require **updating multiple
You can provide a custom `sidebarItemsGenerator` function in the docs plugin (or preset) config: You can provide a custom `sidebarItemsGenerator` function in the docs plugin (or preset) config:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-content-docs', '@docusaurus/plugin-content-docs',
@ -477,7 +477,7 @@ function reverseSidebarItems(items) {
} }
// highlight-end // highlight-end
module.exports = { export default {
plugins: [ plugins: [
[ [
'@docusaurus/plugin-content-docs', '@docusaurus/plugin-content-docs',

View file

@ -16,14 +16,14 @@ To use sidebars on your Docusaurus site:
2. Pass this object into the `@docusaurus/plugin-docs` plugin directly or via `@docusaurus/preset-classic`. 2. Pass this object into the `@docusaurus/plugin-docs` plugin directly or via `@docusaurus/preset-classic`.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
{ {
docs: { docs: {
// highlight-next-line // highlight-next-line
sidebarPath: require.resolve('./sidebars.js'), sidebarPath: './sidebars.js',
}, },
}, },
], ],
@ -44,7 +44,7 @@ import DocCardList from '@theme/DocCardList';
If the `sidebarPath` is unspecified, Docusaurus [automatically generates a sidebar](autogenerated.mdx) for you, by using the filesystem structure of the `docs` folder: If the `sidebarPath` is unspecified, Docusaurus [automatically generates a sidebar](autogenerated.mdx) for you, by using the filesystem structure of the `docs` folder:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
mySidebar: [ mySidebar: [
{ {
type: 'autogenerated', type: 'autogenerated',
@ -71,7 +71,7 @@ type Sidebar =
For example: For example:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
mySidebar: [ mySidebar: [
{ {
type: 'category', type: 'category',
@ -123,7 +123,7 @@ type SidebarsFile = {
By enabling the `themeConfig.docs.sidebar.hideable` option, you can make the entire sidebar hideable, allowing users to better focus on the content. This is especially useful when content is consumed on medium-sized screens (e.g. tablets). By enabling the `themeConfig.docs.sidebar.hideable` option, you can make the entire sidebar hideable, allowing users to better focus on the content. This is especially useful when content is consumed on medium-sized screens (e.g. tablets).
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// highlight-start // highlight-start
docs: { docs: {
@ -141,7 +141,7 @@ module.exports = {
The `themeConfig.docs.sidebar.autoCollapseCategories` option would collapse all sibling categories when expanding one category. This saves the user from having too many categories open and helps them focus on the selected section. The `themeConfig.docs.sidebar.autoCollapseCategories` option would collapse all sibling categories when expanding one category. This saves the user from having too many categories open and helps them focus on the selected section.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
themeConfig: { themeConfig: {
// highlight-start // highlight-start
docs: { docs: {
@ -178,7 +178,7 @@ By default, breadcrumbs are rendered at the top, using the "sidebar path" of the
This behavior can be disabled with plugin options: This behavior can be disabled with plugin options:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',

View file

@ -42,7 +42,7 @@ type SidebarItemDoc =
Example: Example:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
mySidebar: [ mySidebar: [
// Normal syntax: // Normal syntax:
// highlight-start // highlight-start
@ -92,7 +92,7 @@ type SidebarItemLink = {
Example: Example:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
myLinksSidebar: [ myLinksSidebar: [
// highlight-start // highlight-start
// External link // External link
@ -133,7 +133,7 @@ type SidebarItemHtml = {
Example: Example:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
myHtmlSidebar: [ myHtmlSidebar: [
// highlight-start // highlight-start
{ {
@ -151,7 +151,7 @@ module.exports = {
The menu item is already wrapped in an `<li>` tag, so if your custom item is simple, such as a title, just supply a string as the value and use the `className` property to style it: The menu item is already wrapped in an `<li>` tag, so if your custom item is simple, such as a title, just supply a string as the value and use the `className` property to style it:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
myHtmlSidebar: [ myHtmlSidebar: [
{ {
type: 'html', type: 'html',
@ -186,7 +186,7 @@ type SidebarItemCategory = {
Example: Example:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
docs: [ docs: [
{ {
type: 'category', type: 'category',
@ -211,7 +211,7 @@ module.exports = {
Use the [**shorthand syntax**](#category-shorthand) when you don't need customizations: Use the [**shorthand syntax**](#category-shorthand) when you don't need customizations:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
docs: { docs: {
Guides: [ Guides: [
'creating-pages', 'creating-pages',
@ -242,7 +242,7 @@ Autogenerated categories can use the [`_category_.yml`](./autogenerated.mdx#cate
You can auto-generate an index page that displays all the direct children of this category. The `slug` allows you to customize the generated page's route, which defaults to `/category/[categoryName]`. You can auto-generate an index page that displays all the direct children of this category. The `slug` allows you to customize the generated page's route, which defaults to `/category/[categoryName]`.
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
docs: [ docs: [
{ {
type: 'category', type: 'category',
@ -276,7 +276,7 @@ Use `generated-index` links as a quick way to get an introductory document.
A category can link to an existing document. A category can link to an existing document.
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
docs: [ docs: [
{ {
type: 'category', type: 'category',
@ -317,7 +317,7 @@ import DocCardList from '@theme/DocCardList';
We support the option to expand/collapse categories. Categories are collapsible by default, but you can disable collapsing with `collapsible: false`. We support the option to expand/collapse categories. Categories are collapsible by default, but you can disable collapsing with `collapsible: false`.
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
docs: [ docs: [
{ {
type: 'category', type: 'category',
@ -340,7 +340,7 @@ module.exports = {
To make all categories non-collapsible by default, set the `sidebarCollapsible` option in `plugin-content-docs` to `false`: To make all categories non-collapsible by default, set the `sidebarCollapsible` option in `plugin-content-docs` to `false`:
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -366,7 +366,7 @@ The option in `sidebars.js` takes precedence over plugin configuration, so it is
Collapsible categories are collapsed by default. If you want them to be expanded on the first render, you can set `collapsed` to `false`: Collapsible categories are collapsed by default. If you want them to be expanded on the first render, you can set `collapsed` to `false`:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
docs: { docs: {
Guides: [ Guides: [
'creating-pages', 'creating-pages',
@ -385,7 +385,7 @@ module.exports = {
Similar to `collapsible`, you can also set the global configuration `options.sidebarCollapsed` to `false`. Individual `collapsed` options in `sidebars.js` will still take precedence over this configuration. Similar to `collapsible`, you can also set the global configuration `options.sidebarCollapsed` to `false`. Individual `collapsed` options in `sidebars.js` will still take precedence over this configuration.
```js title="docusaurus.config.js" ```js title="docusaurus.config.js"
module.exports = { export default {
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',
@ -420,7 +420,7 @@ An item with type `doc` can be simply a string representing its ID:
``` ```
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
sidebar: [ sidebar: [
// highlight-start // highlight-start
{ {
@ -438,7 +438,7 @@ module.exports = {
``` ```
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
sidebar: [ sidebar: [
// highlight-start // highlight-start
'myDoc', 'myDoc',
@ -455,7 +455,7 @@ module.exports = {
So it's possible to simplify the example above to: So it's possible to simplify the example above to:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
mySidebar: [ mySidebar: [
{ {
type: 'category', type: 'category',
@ -494,7 +494,7 @@ A category item can be represented by an object whose key is its label, and the
``` ```
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
sidebar: [ sidebar: [
// highlight-start // highlight-start
{ {
@ -513,7 +513,7 @@ module.exports = {
``` ```
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
sidebar: [ sidebar: [
// highlight-start // highlight-start
{ {
@ -532,7 +532,7 @@ module.exports = {
This permits us to simplify that example to: This permits us to simplify that example to:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
mySidebar: [ mySidebar: [
// highlight-start // highlight-start
{ {
@ -554,7 +554,7 @@ module.exports = {
Each shorthand object after this transformation will contain exactly one entry. Now consider the further simplified example below: Each shorthand object after this transformation will contain exactly one entry. Now consider the further simplified example below:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
mySidebar: [ mySidebar: [
// highlight-start // highlight-start
{ {
@ -581,7 +581,7 @@ Wherever you have an array of items that is reduced to one category shorthand, y
``` ```
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
sidebar: [ sidebar: [
{ {
'Getting started': ['doc1'], 'Getting started': ['doc1'],
@ -602,7 +602,7 @@ module.exports = {
``` ```
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
sidebar: { sidebar: {
'Getting started': ['doc1'], 'Getting started': ['doc1'],
Docusaurus: { Docusaurus: {

View file

@ -18,7 +18,7 @@ The Docusaurus site is a good example of using multiple sidebars:
Consider this example: Consider this example:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
tutorialSidebar: { tutorialSidebar: {
'Category A': ['doc1', 'doc2'], 'Category A': ['doc1', 'doc2'],
}, },
@ -33,7 +33,7 @@ When browsing `doc1` or `doc2`, the `tutorialSidebar` will be displayed; when br
Following the example above, if a `commonDoc` is included in both sidebars: Following the example above, if a `commonDoc` is included in both sidebars:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
tutorialSidebar: { tutorialSidebar: {
'Category A': ['doc1', 'doc2', 'commonDoc'], 'Category A': ['doc1', 'doc2', 'commonDoc'],
}, },
@ -51,7 +51,7 @@ When you add doc Y to sidebar X, it creates a two-way binding: sidebar X contain
Front matter option `displayed_sidebar` will forcibly set the sidebar association. For the same example, you can still use doc shorthands without any special configuration: Front matter option `displayed_sidebar` will forcibly set the sidebar association. For the same example, you can still use doc shorthands without any special configuration:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
tutorialSidebar: { tutorialSidebar: {
'Category A': ['doc1', 'doc2'], 'Category A': ['doc1', 'doc2'],
}, },
@ -88,7 +88,7 @@ If a sidebar is displayed by setting `displayed_sidebar` front matter, and this
You can customize pagination with front matter `pagination_next` and `pagination_prev`. Consider this sidebar: You can customize pagination with front matter `pagination_next` and `pagination_prev`. Consider this sidebar:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
tutorial: [ tutorial: [
'introduction', 'introduction',
{ {
@ -123,7 +123,7 @@ It is particularly useful where you wish to link to the same document from multi
Consider this example: Consider this example:
```js title="sidebars.js" ```js title="sidebars.js"
module.exports = { export default {
tutorialSidebar: { tutorialSidebar: {
'Category A': [ 'Category A': [
'doc1', 'doc1',
@ -135,7 +135,6 @@ module.exports = {
}, },
apiSidebar: ['doc3', 'doc4', 'commonDoc'], apiSidebar: ['doc3', 'doc4', 'commonDoc'],
}; };
}
``` ```
You can think of the `ref` type as the equivalent to doing the following: You can think of the `ref` type as the equivalent to doing the following:

Some files were not shown because too many files have changed in this diff Show more