mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
chore: v3.0.0-rc.0 release (#9418)
This commit is contained in:
parent
4e150d2b82
commit
7ee2f75ce1
140 changed files with 1598 additions and 677 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "new.docusaurus.io",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "npx --package netlify-cli netlify dev"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "argos",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Argos visual diff tests",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"useNx": false,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "create-docusaurus",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Create Docusaurus apps easily.",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
|
@ -22,8 +22,8 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"commander": "^5.1.0",
|
||||
"fs-extra": "^11.1.1",
|
||||
"lodash": "^4.17.21",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docusaurus-2-classic-typescript-template",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
@ -15,8 +15,8 @@
|
|||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/preset-classic": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/preset-classic": "3.0.0-rc.0",
|
||||
"@mdx-js/react": "^2.3.0",
|
||||
"clsx": "^1.2.1",
|
||||
"prism-react-renderer": "^2.1.0",
|
||||
|
@ -24,9 +24,9 @@
|
|||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/tsconfig": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"@docusaurus/tsconfig": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"typescript": "~5.2.2"
|
||||
},
|
||||
"browserslist": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docusaurus-2-classic-template",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
@ -14,8 +14,8 @@
|
|||
"write-heading-ids": "docusaurus write-heading-ids"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/preset-classic": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/preset-classic": "3.0.0-rc.0",
|
||||
"@mdx-js/react": "^2.3.0",
|
||||
"clsx": "^1.2.1",
|
||||
"prism-react-renderer": "^2.1.0",
|
||||
|
@ -23,8 +23,8 @@
|
|||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0"
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/cssnano-preset",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Advanced cssnano preset for maximum optimization.",
|
||||
"main": "lib/index.js",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/logger",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "An encapsulated logger for semantically formatting console messages.",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/mdx-loader",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Docusaurus Loader for MDX",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
@ -20,9 +20,9 @@
|
|||
"dependencies": {
|
||||
"@babel/parser": "^7.22.7",
|
||||
"@babel/traverse": "^7.22.8",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"@mdx-js/mdx": "^2.1.5",
|
||||
"@slorber/remark-comment": "^1.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
|
@ -35,8 +35,8 @@
|
|||
"mdast-util-to-string": "^3.2.0",
|
||||
"rehype-raw": "^6.1.1",
|
||||
"remark-directive": "^2.0.1",
|
||||
"remark-frontmatter": "^5.0.0",
|
||||
"remark-emoji": "^2.2.0",
|
||||
"remark-frontmatter": "^5.0.0",
|
||||
"remark-gfm": "^3.0.1",
|
||||
"stringify-object": "^3.3.0",
|
||||
"tslib": "^2.6.0",
|
||||
|
@ -47,7 +47,7 @@
|
|||
"webpack": "^5.88.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@types/escape-html": "^1.0.2",
|
||||
"@types/mdast": "^3.0.12",
|
||||
"@types/stringify-object": "^3.3.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/module-type-aliases",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Docusaurus module type aliases.",
|
||||
"types": "./src/index.d.ts",
|
||||
"publishConfig": {
|
||||
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@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/react": "*",
|
||||
"@types/react-router-config": "*",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-client-redirects",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Client redirects plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
@ -18,18 +18,18 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-common": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-common": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"eta": "^2.2.0",
|
||||
"fs-extra": "^11.1.1",
|
||||
"lodash": "^4.17.21",
|
||||
"tslib": "^2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/types": "3.0.0-beta.0"
|
||||
"@docusaurus/types": "3.0.0-rc.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-content-blog",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Blog plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-content-blog.d.ts",
|
||||
|
@ -19,13 +19,13 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-common": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-common": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"feed": "^4.2.2",
|
||||
"fs-extra": "^11.1.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-content-docs",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Docs plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"sideEffects": false,
|
||||
|
@ -35,13 +35,13 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-beta.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-rc.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"@types/react-router-config": "^5.0.7",
|
||||
"combine-promises": "^1.1.0",
|
||||
"fs-extra": "^11.1.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-content-pages",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Pages plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-content-pages.d.ts",
|
||||
|
@ -18,11 +18,11 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"fs-extra": "^11.1.1",
|
||||
"tslib": "^2.6.0",
|
||||
"webpack": "^5.88.1"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-debug",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Debug plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-debug.d.ts",
|
||||
|
@ -20,9 +20,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@microlink/react-json-view": "^1.22.2",
|
||||
"fs-extra": "^11.1.1",
|
||||
"tslib": "^2.6.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
@ -18,9 +18,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"tslib": "^2.6.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
@ -18,9 +18,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"@types/gtag.js": "^0.0.12",
|
||||
"tslib": "^2.6.0"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
@ -18,9 +18,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"tslib": "^2.6.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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).",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-ideal-image.d.ts",
|
||||
|
@ -20,12 +20,12 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/lqip-loader": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/lqip-loader": "3.0.0-rc.0",
|
||||
"@docusaurus/responsive-loader": "^1.7.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"@slorber/react-ideal-image": "^0.0.12",
|
||||
"react-waypoint": "^10.3.0",
|
||||
"sharp": "^0.32.3",
|
||||
|
@ -33,7 +33,7 @@
|
|||
"webpack": "^5.88.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"fs-extra": "^11.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-pwa",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Docusaurus Plugin to add PWA support.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-pwa.d.ts",
|
||||
|
@ -22,12 +22,12 @@
|
|||
"dependencies": {
|
||||
"@babel/core": "^7.22.9",
|
||||
"@babel/preset-env": "^7.22.9",
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-common": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-common": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"babel-loader": "^9.1.3",
|
||||
"clsx": "^1.2.1",
|
||||
"core-js": "^3.31.1",
|
||||
|
@ -41,7 +41,7 @@
|
|||
"workbox-window": "^6.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"fs-extra": "^11.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-sitemap",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Simple sitemap generation plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
@ -18,12 +18,12 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-common": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-common": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"fs-extra": "^11.1.1",
|
||||
"sitemap": "^7.1.1",
|
||||
"tslib": "^2.6.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/preset-classic",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Classic preset for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
@ -18,19 +18,19 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-blog": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-docs": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-pages": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-debug": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-google-analytics": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-google-gtag": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-google-tag-manager": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-sitemap": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-classic": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-common": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-search-algolia": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0"
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-blog": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-docs": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-pages": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-debug": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-google-analytics": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-google-gtag": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-google-tag-manager": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-sitemap": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-classic": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-common": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-search-algolia": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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.",
|
||||
"main": "lib/index.js",
|
||||
"publishConfig": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-classic",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Classic theme for Docusaurus",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/theme-classic.d.ts",
|
||||
|
@ -20,18 +20,18 @@
|
|||
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-beta.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-blog": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-docs": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-pages": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-common": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-common": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-rc.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-blog": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-docs": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-pages": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-common": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-common": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"@mdx-js/react": "^2.1.5",
|
||||
"clsx": "^1.2.1",
|
||||
"copy-text-to-clipboard": "^3.2.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-common",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Common code for Docusaurus themes.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
@ -30,13 +30,13 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/mdx-loader": "3.0.0-beta.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-blog": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-docs": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-pages": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-common": "3.0.0-beta.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-rc.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-blog": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-docs": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-pages": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-common": "3.0.0-rc.0",
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router-config": "*",
|
||||
|
@ -47,8 +47,8 @@
|
|||
"utility-types": "^3.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"fs-extra": "^11.1.1",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-live-codeblock",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Docusaurus live code block component.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/theme-live-codeblock.d.ts",
|
||||
|
@ -23,10 +23,10 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-common": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-common": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"@philpl/buble": "^0.19.7",
|
||||
"clsx": "^1.2.1",
|
||||
"fs-extra": "^11.1.1",
|
||||
|
@ -34,7 +34,7 @@
|
|||
"tslib": "^2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@types/buble": "^0.20.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-mermaid",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Mermaid components for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/theme-mermaid.d.ts",
|
||||
|
@ -33,11 +33,11 @@
|
|||
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-common": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-common": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"mermaid": "^10.4.0",
|
||||
"tslib": "^2.6.0"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-search-algolia",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Algolia search component for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"sideEffects": [
|
||||
|
@ -34,13 +34,13 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@docsearch/react": "^3.5.2",
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-content-docs": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-common": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-content-docs": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-common": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-translations": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"algoliasearch": "^4.18.0",
|
||||
"algoliasearch-helper": "^3.13.3",
|
||||
"clsx": "^1.2.1",
|
||||
|
@ -51,7 +51,7 @@
|
|||
"utility-types": "^3.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0"
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-translations",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Docusaurus theme translations.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
@ -23,8 +23,8 @@
|
|||
"tslib": "^2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/tsconfig",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Docusaurus base TypeScript configuration.",
|
||||
"main": "tsconfig.json",
|
||||
"publishConfig": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/types",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Common types for Docusaurus packages.",
|
||||
"types": "./src/index.d.ts",
|
||||
"publishConfig": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/utils-validation",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Node validation utility functions for Docusaurus packages.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
@ -18,8 +18,8 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"joi": "^17.9.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"tslib": "^2.6.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/utils",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "Node utility functions for Docusaurus packages.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@svgr/webpack": "^6.5.1",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"file-loader": "^6.2.0",
|
||||
|
@ -40,7 +40,7 @@
|
|||
"node": ">=18.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@types/dedent": "^0.7.0",
|
||||
"@types/github-slugger": "^1.3.0",
|
||||
"@types/micromatch": "^4.0.2",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@docusaurus/core",
|
||||
"description": "Easy to Maintain Open Source Documentation Websites",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@ -43,13 +43,13 @@
|
|||
"@babel/runtime": "^7.22.6",
|
||||
"@babel/runtime-corejs3": "^7.22.6",
|
||||
"@babel/traverse": "^7.22.8",
|
||||
"@docusaurus/cssnano-preset": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-beta.0",
|
||||
"@docusaurus/cssnano-preset": "3.0.0-rc.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/mdx-loader": "3.0.0-rc.0",
|
||||
"@docusaurus/react-loadable": "5.5.2",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-common": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-common": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-validation": "3.0.0-rc.0",
|
||||
"@slorber/static-site-generator-webpack-plugin": "^4.0.7",
|
||||
"@svgr/webpack": "^6.5.1",
|
||||
"autoprefixer": "^10.4.14",
|
||||
|
@ -105,8 +105,8 @@
|
|||
"webpackbar": "^5.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
|
||||
"@docusaurus/types": "3.0.0-beta.0",
|
||||
"@docusaurus/module-type-aliases": "3.0.0-rc.0",
|
||||
"@docusaurus/types": "3.0.0-rc.0",
|
||||
"@types/detect-port": "^1.3.3",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"@types/react-router-config": "^5.0.7",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/eslint-plugin",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"description": "ESLint plugin to enforce best Docusaurus practices.",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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.",
|
||||
"main": "lib/index.js",
|
||||
"publishConfig": {
|
||||
|
@ -17,7 +17,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"sharp": "^0.32.3",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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.",
|
||||
"main": "lib/index.js",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -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.
|
||||
|
||||
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
|
||||
|
||||
|
@ -214,14 +214,14 @@ http://localhost:3000
|
|||
|
||||
#### 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 **lower-cased** custom element name will not be substituted by its respective `MDXComponent` component anymore
|
||||
|
||||
:::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.
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
@ -292,7 +292,7 @@ For users providing a [custom `MDXComponent`mapping](../guides/markdown-features
|
|||
|
||||
:::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.
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "website",
|
||||
"version": "3.0.0-beta.0",
|
||||
"version": "3.0.0-rc.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
@ -36,19 +36,19 @@
|
|||
"dependencies": {
|
||||
"@crowdin/cli": "^3.13.0",
|
||||
"@crowdin/crowdin-api-client": "^1.23.3",
|
||||
"@docusaurus/core": "3.0.0-beta.0",
|
||||
"@docusaurus/logger": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-client-redirects": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-ideal-image": "3.0.0-beta.0",
|
||||
"@docusaurus/plugin-pwa": "3.0.0-beta.0",
|
||||
"@docusaurus/preset-classic": "3.0.0-beta.0",
|
||||
"@docusaurus/remark-plugin-npm2yarn": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-classic": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-common": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-live-codeblock": "3.0.0-beta.0",
|
||||
"@docusaurus/theme-mermaid": "3.0.0-beta.0",
|
||||
"@docusaurus/utils": "3.0.0-beta.0",
|
||||
"@docusaurus/utils-common": "3.0.0-beta.0",
|
||||
"@docusaurus/core": "3.0.0-rc.0",
|
||||
"@docusaurus/logger": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-client-redirects": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-ideal-image": "3.0.0-rc.0",
|
||||
"@docusaurus/plugin-pwa": "3.0.0-rc.0",
|
||||
"@docusaurus/preset-classic": "3.0.0-rc.0",
|
||||
"@docusaurus/remark-plugin-npm2yarn": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-classic": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-common": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-live-codeblock": "3.0.0-rc.0",
|
||||
"@docusaurus/theme-mermaid": "3.0.0-rc.0",
|
||||
"@docusaurus/utils": "3.0.0-rc.0",
|
||||
"@docusaurus/utils-common": "3.0.0-rc.0",
|
||||
"@popperjs/core": "^2.11.8",
|
||||
"@swc/core": "1.2.197",
|
||||
"clsx": "^1.2.1",
|
||||
|
@ -83,8 +83,8 @@
|
|||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/eslint-plugin": "3.0.0-beta.0",
|
||||
"@docusaurus/tsconfig": "3.0.0-beta.0",
|
||||
"@docusaurus/eslint-plugin": "3.0.0-rc.0",
|
||||
"@docusaurus/tsconfig": "3.0.0-rc.0",
|
||||
"@types/color": "^3.0.4",
|
||||
"@types/jest": "^29.5.3",
|
||||
"cross-env": "^7.0.3",
|
||||
|
|
|
@ -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:
|
||||
|
||||
- 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.
|
||||
|
||||
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).
|
|
@ -1,6 +1,6 @@
|
|||
# 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}
|
||||
|
||||
|
@ -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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
plugins: [
|
||||
// highlight-start
|
||||
|
@ -38,7 +38,7 @@ module.exports = {
|
|||
You can use a plugin as a module path referencing a separate file or npm package:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
plugins: [
|
||||
// without options:
|
||||
|
@ -52,7 +52,7 @@ module.exports = {
|
|||
Then in the folder `my-plugin`, you can create an `index.js` such as this:
|
||||
|
||||
```js title="my-plugin/index.js"
|
||||
module.exports = async function myPlugin(context, options) {
|
||||
export default async function myPlugin(context, options) {
|
||||
// ...
|
||||
return {
|
||||
name: 'my-plugin',
|
||||
|
@ -64,7 +64,7 @@ module.exports = async function myPlugin(context, options) {
|
|||
},
|
||||
/* other lifecycle API */
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
@ -99,7 +99,7 @@ This is a contrived example: in practice, `@docusaurus/theme-classic` provides t
|
|||
:::
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// highlight-next-line
|
||||
themes: ['theme-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):
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// highlight-next-line
|
||||
themes: ['theme-blog-bootstrap'],
|
||||
plugins: ['plugin-content-blog'],
|
|
@ -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.
|
||||
|
||||
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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
title: 'Docusaurus',
|
||||
url: 'https://docusaurus.io',
|
||||
// your site config ...
|
||||
|
@ -31,13 +39,13 @@ module.exports = {
|
|||
```
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = async function createConfigAsync() {
|
||||
export default async function createConfigAsync() {
|
||||
return {
|
||||
title: 'Docusaurus',
|
||||
url: 'https://docusaurus.io',
|
||||
// your site config ...
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
:::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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
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`:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
favicon: '/img/favicon.ico',
|
||||
};
|
||||
```
|
||||
|
@ -127,7 +135,7 @@ Example:
|
|||
{/* cSpell:ignore فارسی */}
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'fa'],
|
||||
|
@ -171,7 +179,7 @@ This option adds `<meta name="robots" content="noindex, nofollow">` to every pag
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
tagline:
|
||||
'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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// Docusaurus' organization is 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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
githubPort: '22',
|
||||
};
|
||||
```
|
||||
|
@ -289,7 +297,7 @@ The [theme configuration](./themes/theme-configuration.mdx) object to customize
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
docs: {
|
||||
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`.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
'docusaurus-plugin-awesome',
|
||||
['docusuarus-plugin-confetti', {fancy: false}],
|
||||
|
@ -376,7 +384,7 @@ module.exports = {
|
|||
- Type: `PluginConfig[]`
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themes: ['@docusaurus/theme-classic'],
|
||||
};
|
||||
```
|
||||
|
@ -390,7 +398,7 @@ type PresetConfig = string | [string, any];
|
|||
```
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [],
|
||||
};
|
||||
```
|
||||
|
@ -426,7 +434,7 @@ type MarkdownConfig = {
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
markdown: {
|
||||
format: 'mdx',
|
||||
mermaid: true,
|
||||
|
@ -464,7 +472,7 @@ Docusaurus guards `docusaurus.config.js` from unknown fields. To add a custom fi
|
|||
- Type: `Object`
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
customFields: {
|
||||
admin: 'endi',
|
||||
superman: 'lol',
|
||||
|
@ -487,7 +495,7 @@ An array of paths, relative to the site's directory or absolute. Files under the
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
staticDirectories: ['static'],
|
||||
};
|
||||
```
|
||||
|
@ -501,7 +509,7 @@ An array of tags that will be inserted in the HTML `<head>`. The values must be
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
headTags: [
|
||||
{
|
||||
tagName: 'link',
|
||||
|
@ -527,7 +535,7 @@ Note that `<script>` added here are render-blocking, so you might want to add `a
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
scripts: [
|
||||
// String format.
|
||||
'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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
stylesheets: [
|
||||
// String format.
|
||||
'https://docusaurus.io/style.css',
|
||||
|
@ -574,11 +582,8 @@ An array of [client modules](../advanced/client.mdx#client-modules) to load glob
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
clientModules: [
|
||||
require.resolve('./mySiteGlobalJs.js'),
|
||||
require.resolve('./mySiteGlobalCss.css'),
|
||||
],
|
||||
export default {
|
||||
clientModules: ['./mySiteGlobalJs.js', './mySiteGlobalCss.css'],
|
||||
};
|
||||
```
|
||||
|
||||
|
@ -591,7 +596,7 @@ An HTML template written in [Eta's syntax](https://eta.js.org/docs/syntax#syntax
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
ssrTemplate: `<!DOCTYPE html>
|
||||
<html <%~ it.htmlAttributes %>>
|
||||
<head>
|
||||
|
@ -631,7 +636,7 @@ Will be used as title delimiter in the generated `<title>` tag.
|
|||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
baseUrlIssueBanner: true, // Defaults to `true`
|
||||
};
|
||||
```
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
@ -47,7 +47,7 @@ Here's a mental model for a presumptuous plugin implementation.
|
|||
// A JavaScript function that returns an object.
|
||||
// `context` is provided by Docusaurus. Example: siteConfig can be accessed from context.
|
||||
// `opts` is the user-defined options.
|
||||
async function myPlugin(context, opts) {
|
||||
export default async function myPlugin(context, opts) {
|
||||
return {
|
||||
// A compulsory field used as the namespace for directories to cache
|
||||
// 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);
|
||||
return validatedOptions;
|
||||
};
|
||||
}
|
||||
|
||||
myPlugin.validateThemeConfig = ({themeConfig, validate}) => {
|
||||
export function validateThemeConfig({themeConfig, validate}) {
|
||||
const validatedThemeConfig = validate(myValidationSchema, options);
|
||||
return validatedThemeConfig;
|
||||
};
|
||||
|
||||
module.exports = myPlugin;
|
||||
}
|
||||
```
|
|
@ -15,8 +15,9 @@ Use this for files that are consumed server-side, because theme files are automa
|
|||
Example:
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
const path = require('path');
|
||||
module.exports = function (context, options) {
|
||||
import path from 'path';
|
||||
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'docusaurus-plugin',
|
||||
// highlight-start
|
||||
|
@ -26,7 +27,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `extendCli(cli)` {#extendCli}
|
||||
|
@ -42,7 +43,7 @@ The commander version matters! We use commander v5, and make sure you are referr
|
|||
Example:
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'docusaurus-plugin',
|
||||
// highlight-start
|
||||
|
@ -56,7 +57,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `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:
|
||||
|
||||
```js title="my-theme/src/index.js"
|
||||
const path = require('path');
|
||||
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'my-theme',
|
||||
// highlight-start
|
||||
|
@ -77,7 +76,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `getTypeScriptThemePath()` {#getTypeScriptThemePath}
|
||||
|
@ -95,9 +94,7 @@ You should also format these files with Prettier. Remember—JS files can and wi
|
|||
Example:
|
||||
|
||||
```js title="my-theme/src/index.js"
|
||||
const path = require('path');
|
||||
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'my-theme',
|
||||
// highlight-start
|
||||
|
@ -111,7 +108,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `getSwizzleComponentList()` {#getSwizzleComponentList}
|
||||
|
@ -121,7 +118,8 @@ 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.
|
||||
|
||||
```js title="my-theme/src/index.js"
|
||||
const swizzleAllowedComponents = [
|
||||
export function getSwizzleComponentList() {
|
||||
return [
|
||||
'CodeBlock',
|
||||
'DocSidebar',
|
||||
'Footer',
|
||||
|
@ -129,7 +127,6 @@ const swizzleAllowedComponents = [
|
|||
'SearchBar',
|
||||
'hooks/useTheme',
|
||||
'prism-include-languages',
|
||||
];
|
||||
|
||||
myTheme.getSwizzleComponentList = () => swizzleAllowedComponents;
|
||||
];
|
||||
}
|
||||
```
|
|
@ -19,8 +19,8 @@ These files will be written by the [`write-translations` CLI](../../cli.mdx#docu
|
|||
|
||||
Example:
|
||||
|
||||
```js
|
||||
module.exports = function (context, options) {
|
||||
```js title="my-plugin.js"
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'my-plugin',
|
||||
// highlight-start
|
||||
|
@ -40,7 +40,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `translateContent({content,translationFiles})` {#translateContent}
|
||||
|
@ -53,8 +53,8 @@ The `contentLoaded()` lifecycle will be called with the localized plugin content
|
|||
|
||||
Example:
|
||||
|
||||
```js
|
||||
module.exports = function (context, options) {
|
||||
```js title="my-plugin.js"
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'my-plugin',
|
||||
// highlight-start
|
||||
|
@ -69,7 +69,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `translateThemeConfig({themeConfig,translationFiles})` {#translateThemeConfig}
|
||||
|
@ -80,8 +80,8 @@ Returns the localized `themeConfig`.
|
|||
|
||||
Example:
|
||||
|
||||
```js
|
||||
module.exports = function (context, options) {
|
||||
```js title="my-plugin.js"
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'my-theme',
|
||||
// highlight-start
|
||||
|
@ -96,7 +96,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `async getDefaultCodeTranslationMessages()` {#getDefaultCodeTranslationMessages}
|
||||
|
@ -107,8 +107,8 @@ It should return messages in `Record<string, string>`, where keys are translatio
|
|||
|
||||
Example:
|
||||
|
||||
```js
|
||||
module.exports = function (context, options) {
|
||||
```js title="my-plugin.js"
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'my-theme',
|
||||
// highlight-start
|
||||
|
@ -117,5 +117,5 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
|
@ -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.
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'docusaurus-plugin',
|
||||
// highlight-start
|
||||
|
@ -23,7 +23,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `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.
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'custom-docusaurus-plugin',
|
||||
// highlight-start
|
||||
|
@ -202,7 +202,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
### `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:
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'custom-docusaurus-plugin',
|
||||
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.
|
||||
|
@ -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.
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'custom-docusaurus-plugin',
|
||||
configureWebpack(config, isServer, utils) {
|
||||
|
@ -251,7 +251,7 @@ module.exports = function (context, options) {
|
|||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `configurePostCss(options)` {#configurePostCss}
|
||||
|
@ -272,7 +272,7 @@ const postcssOptions = {
|
|||
Example:
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'docusaurus-plugin',
|
||||
// highlight-start
|
||||
|
@ -283,7 +283,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `postBuild(props)` {#postBuild}
|
||||
|
@ -309,7 +309,7 @@ interface Props {
|
|||
Example:
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'docusaurus-plugin',
|
||||
// highlight-start
|
||||
|
@ -321,7 +321,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## `injectHtmlTags({content})` {#injectHtmlTags}
|
||||
|
@ -361,7 +361,7 @@ type HtmlTagObject = {
|
|||
Example:
|
||||
|
||||
```js title="docusaurus-plugin/src/index.js"
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
return {
|
||||
name: 'docusaurus-plugin',
|
||||
loadContent: async () => {
|
||||
|
@ -394,7 +394,7 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```js title="my-theme/src/index.js"
|
||||
const path = require('path');
|
||||
|
||||
module.exports = function (context, options) {
|
||||
export default function (context, options) {
|
||||
const {customCss, customJs} = options || {};
|
||||
return {
|
||||
name: 'name-of-my-theme',
|
||||
|
@ -422,5 +420,5 @@ module.exports = function (context, options) {
|
|||
},
|
||||
// highlight-end
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
|
@ -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.
|
||||
|
||||
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.
|
||||
|
||||
```js title="my-plugin/src/index.js"
|
||||
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) {
|
||||
export default function myPlugin(context, options) {
|
||||
return {
|
||||
name: 'docusaurus-plugin',
|
||||
// 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.
|
||||
|
||||
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.
|
||||
|
||||
```js title="my-theme/src/index.js"
|
||||
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) {
|
||||
export default function myPlugin(context, options) {
|
||||
return {
|
||||
name: 'docusaurus-plugin',
|
||||
// rest of methods
|
|
@ -89,7 +89,7 @@ type CreateRedirectsFn = (path: string) => string[] | string | null | undefined;
|
|||
Here's an example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-client-redirects',
|
|
@ -169,7 +169,7 @@ const config = {
|
|||
blogPostComponent: '@theme/BlogPostPage',
|
||||
blogTagsListComponent: '@theme/BlogTagsListPage',
|
||||
blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
|
||||
remarkPlugins: [require('remark-math')],
|
||||
remarkPlugins: [require('./my-remark-plugin')],
|
||||
rehypePlugins: [],
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
beforeDefaultRehypePlugins: [],
|
||||
|
@ -249,7 +249,7 @@ Example:
|
|||
|
||||
```md
|
||||
---
|
||||
title: Welcome Docusaurus v2
|
||||
title: Welcome Docusaurus
|
||||
authors:
|
||||
- slorber
|
||||
- yangshun
|
||||
|
@ -258,7 +258,7 @@ authors:
|
|||
url: https://github.com/JoelMarcey
|
||||
image_url: https://github.com/JoelMarcey.png
|
||||
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
|
||||
hide_table_of_contents: false
|
||||
---
|
|
@ -234,7 +234,7 @@ const config = {
|
|||
},
|
||||
docLayoutComponent: '@theme/DocPage',
|
||||
docItemComponent: '@theme/DocItem',
|
||||
remarkPlugins: [require('remark-math')],
|
||||
remarkPlugins: [require('./my-remark-plugin')],
|
||||
rehypePlugins: [],
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
beforeDefaultRehypePlugins: [],
|
|
@ -72,7 +72,7 @@ const config = {
|
|||
'**/__tests__/**',
|
||||
],
|
||||
mdxPageComponent: '@theme/MDXPage',
|
||||
remarkPlugins: [require('remark-math')],
|
||||
remarkPlugins: [require('./my-remark-plugin')],
|
||||
rehypePlugins: [],
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
beforeDefaultRehypePlugins: [],
|
|
@ -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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
// highlight-next-line
|
||||
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):
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
|
@ -96,7 +96,7 @@ module.exports = {
|
|||
If you are using a standalone plugin, provide options directly to the plugin:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// highlight-next-line
|
||||
plugins: ['@docusaurus/plugin-debug'],
|
||||
};
|
|
@ -73,7 +73,7 @@ Accepted fields:
|
|||
Here's an example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-ideal-image',
|
|
@ -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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-pwa',
|
||||
|
@ -148,7 +148,7 @@ The [`standalone` strategy](https://petelepage.com/blog/2019/07/is-my-pwa-instal
|
|||
- Default: `{}`
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@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:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-pwa',
|
||||
|
@ -288,7 +288,7 @@ The Docusaurus site manifest can serve as an inspiration:
|
|||
import CodeBlock from '@theme/CodeBlock';
|
||||
|
||||
<CodeBlock className="language-json">
|
||||
{JSON.stringify(require("@site/static/manifest.json"),null,2)}
|
||||
{JSON.stringify(require('@site/static/manifest.json'),null,2)}
|
||||
</CodeBlock>
|
||||
```
|
||||
|
|
@ -58,6 +58,6 @@ Most Docusaurus users configure this plugin through the preset options.
|
|||
// Plugin Options: @docusaurus/theme-classic
|
||||
|
||||
const config = {
|
||||
customCss: require.resolve('./src/css/custom.css'),
|
||||
customCss: './src/css/custom.css',
|
||||
};
|
||||
```
|
|
@ -38,7 +38,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// highlight-start
|
||||
colorMode: {
|
||||
|
@ -80,7 +80,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// highlight-next-line
|
||||
image: 'img/docusaurus.png',
|
||||
|
@ -109,7 +109,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// highlight-next-line
|
||||
metadata: [{name: 'twitter:card', content: 'summary'}],
|
||||
|
@ -142,7 +142,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// highlight-start
|
||||
announcementBar: {
|
||||
|
@ -209,7 +209,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
title: 'Site Title',
|
||||
|
@ -236,7 +236,7 @@ module.exports = {
|
|||
You can add items to the navbar via `themeConfig.navbar.items`.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
// highlight-start
|
||||
|
@ -311,7 +311,7 @@ In addition to the fields above, you can specify other arbitrary attributes that
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
items: [
|
||||
|
@ -368,7 +368,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
items: [
|
||||
|
@ -422,7 +422,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
items: [
|
||||
|
@ -471,7 +471,7 @@ Use this navbar item type if your sidebar is updated often and the order is not
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
items: [
|
||||
|
@ -490,7 +490,7 @@ module.exports = {
|
|||
```
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
tutorial: [
|
||||
{
|
||||
type: 'autogenerated',
|
||||
|
@ -537,7 +537,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
items: [
|
||||
|
@ -580,7 +580,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
items: [
|
||||
|
@ -625,7 +625,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
items: [
|
||||
|
@ -668,7 +668,7 @@ However, with this special navbar item type, you can change the default location
|
|||
```
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
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"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
// 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/).
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
// highlight-next-line
|
||||
|
@ -799,12 +799,14 @@ By default, we use [Palenight](https://github.com/FormidableLabs/prism-react-ren
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
import {themes as prismThemes} from 'prism-react-renderer';
|
||||
|
||||
export default {
|
||||
themeConfig: {
|
||||
prism: {
|
||||
// highlight-start
|
||||
theme: require('prism-react-renderer/themes/github'),
|
||||
darkTheme: require('prism-react-renderer/themes/dracula'),
|
||||
theme: prismThemes.github,
|
||||
darkTheme: prismThemes.dracula,
|
||||
// highlight-end
|
||||
},
|
||||
},
|
||||
|
@ -824,7 +826,7 @@ You can set a default language for code blocks if no language is added after the
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
prism: {
|
||||
// highlight-next-line
|
||||
|
@ -858,7 +860,7 @@ Accepted fields:
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// highlight-start
|
||||
footer: {
|
||||
|
@ -915,7 +917,7 @@ Accepted fields of each `FooterItem`:
|
|||
Example multi-column configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
footer: {
|
||||
// highlight-start
|
||||
links: [
|
||||
|
@ -967,7 +969,7 @@ A simple footer just has a list of `FooterItem`s displayed in a row.
|
|||
Example simple configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
footer: {
|
||||
// highlight-start
|
||||
links: [
|
||||
|
@ -1016,7 +1018,7 @@ You can adjust the default table of contents via `themeConfig.tableOfContents`.
|
|||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// highlight-start
|
||||
tableOfContents: {
|
|
@ -14,7 +14,7 @@ npm install --save @docusaurus/theme-live-codeblock
|
|||
### Configuration {#configuration}
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: ['@docusaurus/theme-live-codeblock'],
|
||||
themeConfig: {
|
||||
liveCodeBlock: {
|
|
@ -14,7 +14,7 @@ npm install --save @docusaurus/theme-mermaid
|
|||
## Configuration {#configuration}
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themes: ['@docusaurus/theme-mermaid'],
|
||||
// In order for Mermaid code blocks in Markdown to work,
|
||||
// you also need to enable the Remark plugin with this option
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
@ -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`:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// ...
|
||||
navbar: {
|
||||
|
@ -40,12 +40,12 @@ module.exports = {
|
|||
|
||||
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
|
||||
description: This is my first post on Docusaurus 2.
|
||||
title: Welcome Docusaurus
|
||||
description: This is my first post on Docusaurus.
|
||||
slug: welcome-docusaurus-v2
|
||||
authors:
|
||||
- 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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
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":
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
|
@ -419,7 +419,7 @@ Use the callback for all your customization needs:
|
|||
**Disable reading time on one page:**
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@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:**
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
|
@ -482,9 +482,9 @@ module.exports = {
|
|||
**Use a custom implementation of reading time:**
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
const myReadingTime = require('./myReadingTime');
|
||||
import myReadingTime from './myReadingTime';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
|
@ -539,7 +539,7 @@ type BlogOptions = {
|
|||
Example usage:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
presets: [
|
||||
[
|
||||
|
@ -597,10 +597,10 @@ https://example.com/blog/feed.json
|
|||
|
||||
### 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"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
plugins: [
|
||||
[
|
|
@ -25,15 +25,28 @@ The `docusaurus.config.js` file is run in Node.js and should export either:
|
|||
|
||||
:::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
|
||||
- **Optional:** use `require("lib")` to import Node.js packages
|
||||
- **Optional:** use `await import("lib")` (dynamic import) in an async function to import ESM-Only Node.js packages
|
||||
- [**ES Modules**](https://flaviocopes.com/es-modules/)
|
||||
- [**CommonJS**](https://flaviocopes.com/commonjs/)
|
||||
- [**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"
|
||||
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"
|
||||
const config = {
|
||||
title: 'Docusaurus',
|
||||
|
@ -50,27 +73,27 @@ const config = {
|
|||
// your site config ...
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
export default config;
|
||||
```
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = function configCreator() {
|
||||
export default function configCreator() {
|
||||
return {
|
||||
title: 'Docusaurus',
|
||||
url: 'https://docusaurus.io',
|
||||
// your site config ...
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = async function createConfigAsync() {
|
||||
export default async function createConfigAsync() {
|
||||
return {
|
||||
title: 'Docusaurus',
|
||||
url: 'https://docusaurus.io',
|
||||
// your site config ...
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
:::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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = async function createConfigAsync() {
|
||||
export default async function createConfigAsync() {
|
||||
// Use a dynamic import instead of require('esm-lib')
|
||||
// highlight-next-line
|
||||
const lib = await import('lib');
|
||||
|
@ -88,7 +111,7 @@ module.exports = async function createConfigAsync() {
|
|||
url: 'https://docusaurus.io',
|
||||
// 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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
plugins: [
|
||||
'@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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
plugins: ['content-blog', 'content-pages'],
|
||||
themes: ['classic'],
|
||||
|
@ -147,9 +170,9 @@ module.exports = {
|
|||
They can also be loaded from local directories:
|
||||
|
||||
```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')],
|
||||
};
|
||||
|
@ -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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
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`.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
sidebarPath: './sidebars.js',
|
||||
},
|
||||
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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
// highlight-start
|
||||
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.
|
||||
|
||||
```js title="babel.config.js"
|
||||
module.exports = {
|
||||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
|
||||
export default {
|
||||
presets: ['@docusaurus/core/lib/babel/preset'],
|
||||
};
|
||||
```
|
||||
|
|
@ -61,9 +61,9 @@ Putting potentially sensitive information in the environment is common practice.
|
|||
|
||||
```js title="docusaurus.config.js"
|
||||
// If you are using dotenv (https://www.npmjs.com/package/dotenv)
|
||||
require('dotenv').config();
|
||||
import 'dotenv/config';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
title: '...',
|
||||
url: process.env.URL, // You can use environment variables to control site specifics as well
|
||||
// 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}
|
||||
|
||||
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"
|
||||
module.exports = {
|
||||
export default {
|
||||
// highlight-start
|
||||
url: 'https://docusaurus-2.netlify.app', // Url to your site with no trailing slash
|
||||
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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
url: 'https://endiliey.github.io', // Your website URL
|
||||
baseUrl: '/',
|
|
@ -32,7 +32,7 @@ const SafeComponent = () => (
|
|||
```
|
||||
|
||||
```mdx-code-block
|
||||
import ErrorBoundaryTestButton from "@site/src/components/ErrorBoundaryTestButton"
|
||||
import ErrorBoundaryTestButton from '@site/src/components/ErrorBoundaryTestButton'
|
||||
```
|
||||
|
||||
:::tip
|
|
@ -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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
presets: [
|
||||
[
|
||||
|
@ -66,7 +66,7 @@ module.exports = {
|
|||
To enter docs-only mode, change it to like this:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
// ...
|
||||
presets: [
|
||||
[
|
||||
|
@ -115,6 +115,6 @@ example.com/tutorial-basics/... -> generated from `docs/tutorial-basics/...`
|
|||
|
||||
:::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).
|
||||
|
||||
:::
|
|
@ -64,7 +64,7 @@ In this case, you should use the same plugin twice in your site configuration.
|
|||
When using the preset:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
|
@ -75,7 +75,7 @@ module.exports = {
|
|||
// highlight-end
|
||||
path: 'product',
|
||||
routeBasePath: 'product',
|
||||
sidebarPath: require.resolve('./sidebarsProduct.js'),
|
||||
sidebarPath: './sidebarsProduct.js',
|
||||
// ... other options
|
||||
},
|
||||
},
|
||||
|
@ -90,7 +90,7 @@ module.exports = {
|
|||
// highlight-end
|
||||
path: 'community',
|
||||
routeBasePath: 'community',
|
||||
sidebarPath: require.resolve('./sidebarsCommunity.js'),
|
||||
sidebarPath: './sidebarsCommunity.js',
|
||||
// ... other options
|
||||
},
|
||||
],
|
||||
|
@ -101,7 +101,7 @@ module.exports = {
|
|||
When not using the preset:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-content-docs',
|
||||
|
@ -111,7 +111,7 @@ module.exports = {
|
|||
// highlight-end
|
||||
path: 'product',
|
||||
routeBasePath: 'product',
|
||||
sidebarPath: require.resolve('./sidebarsProduct.js'),
|
||||
sidebarPath: './sidebarsProduct.js',
|
||||
// ... other options
|
||||
},
|
||||
],
|
||||
|
@ -123,7 +123,7 @@ module.exports = {
|
|||
// highlight-end
|
||||
path: 'community',
|
||||
routeBasePath: 'community',
|
||||
sidebarPath: require.resolve('./sidebarsCommunity.js'),
|
||||
sidebarPath: './sidebarsCommunity.js',
|
||||
// ... 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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
items: [
|
|
@ -21,7 +21,7 @@ type SidebarItemAutogenerated = {
|
|||
Docusaurus can generate a full sidebar from your docs folder:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
myAutogeneratedSidebar: [
|
||||
// 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:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
mySidebar: [
|
||||
'intro',
|
||||
{
|
||||
|
@ -109,7 +109,7 @@ module.exports = {
|
|||
It would be resolved as:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
mySidebar: [
|
||||
'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):
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
docs: [
|
||||
// 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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-content-docs',
|
||||
|
@ -247,7 +247,7 @@ module.exports = {
|
|||
Or choose to not have any category index convention.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-content-docs',
|
||||
|
@ -477,7 +477,7 @@ function reverseSidebarItems(items) {
|
|||
}
|
||||
// highlight-end
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-content-docs',
|
|
@ -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`.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
// 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:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
mySidebar: [
|
||||
{
|
||||
type: 'autogenerated',
|
||||
|
@ -71,7 +71,7 @@ type Sidebar =
|
|||
For example:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
mySidebar: [
|
||||
{
|
||||
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).
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// highlight-start
|
||||
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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
themeConfig: {
|
||||
// highlight-start
|
||||
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:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
|
@ -42,7 +42,7 @@ type SidebarItemDoc =
|
|||
Example:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
mySidebar: [
|
||||
// Normal syntax:
|
||||
// highlight-start
|
||||
|
@ -92,7 +92,7 @@ type SidebarItemLink = {
|
|||
Example:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
myLinksSidebar: [
|
||||
// highlight-start
|
||||
// External link
|
||||
|
@ -133,7 +133,7 @@ type SidebarItemHtml = {
|
|||
Example:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
myHtmlSidebar: [
|
||||
// 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:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
myHtmlSidebar: [
|
||||
{
|
||||
type: 'html',
|
||||
|
@ -186,7 +186,7 @@ type SidebarItemCategory = {
|
|||
Example:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
docs: [
|
||||
{
|
||||
type: 'category',
|
||||
|
@ -211,7 +211,7 @@ module.exports = {
|
|||
Use the [**shorthand syntax**](#category-shorthand) when you don't need customizations:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
docs: {
|
||||
Guides: [
|
||||
'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]`.
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
docs: [
|
||||
{
|
||||
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.
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
docs: [
|
||||
{
|
||||
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`.
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
docs: [
|
||||
{
|
||||
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`:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@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`:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
docs: {
|
||||
Guides: [
|
||||
'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.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
|
@ -420,7 +420,7 @@ An item with type `doc` can be simply a string representing its ID:
|
|||
```
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
sidebar: [
|
||||
// highlight-start
|
||||
{
|
||||
|
@ -438,7 +438,7 @@ module.exports = {
|
|||
```
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
sidebar: [
|
||||
// highlight-start
|
||||
'myDoc',
|
||||
|
@ -455,7 +455,7 @@ module.exports = {
|
|||
So it's possible to simplify the example above to:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
mySidebar: [
|
||||
{
|
||||
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"
|
||||
module.exports = {
|
||||
export default {
|
||||
sidebar: [
|
||||
// highlight-start
|
||||
{
|
||||
|
@ -513,7 +513,7 @@ module.exports = {
|
|||
```
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
sidebar: [
|
||||
// highlight-start
|
||||
{
|
||||
|
@ -532,7 +532,7 @@ module.exports = {
|
|||
This permits us to simplify that example to:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
mySidebar: [
|
||||
// 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:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
mySidebar: [
|
||||
// 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"
|
||||
module.exports = {
|
||||
export default {
|
||||
sidebar: [
|
||||
{
|
||||
'Getting started': ['doc1'],
|
||||
|
@ -602,7 +602,7 @@ module.exports = {
|
|||
```
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
sidebar: {
|
||||
'Getting started': ['doc1'],
|
||||
Docusaurus: {
|
|
@ -18,7 +18,7 @@ The Docusaurus site is a good example of using multiple sidebars:
|
|||
Consider this example:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
tutorialSidebar: {
|
||||
'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:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
tutorialSidebar: {
|
||||
'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:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
tutorialSidebar: {
|
||||
'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:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
tutorial: [
|
||||
'introduction',
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ It is particularly useful where you wish to link to the same document from multi
|
|||
Consider this example:
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
export default {
|
||||
tutorialSidebar: {
|
||||
'Category A': [
|
||||
'doc1',
|
||||
|
@ -135,7 +135,6 @@ module.exports = {
|
|||
},
|
||||
apiSidebar: ['doc3', 'doc4', 'commonDoc'],
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
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
Loading…
Add table
Add a link
Reference in a new issue