chore: prepare v2.0.0-beta.9 release (#5859)

* chore: prepare v2.0.0-beta.9 release

* v2.0.0-beta.9
This commit is contained in:
Alexey Pyltsyn 2021-11-02 20:40:01 +03:00 committed by GitHub
parent c2009ab6b7
commit 91ec2509b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 698 additions and 298 deletions

View file

@ -1,5 +1,109 @@
# Docusaurus 2 Changelog
## 2.0.0-beta.9 (2021-11-02)
#### :rocket: New Feature
- `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#5770](https://github.com/facebook/docusaurus/pull/5770) feat(theme-classic): allow specifying width/height in logo ([@cerkiewny](https://github.com/cerkiewny))
- `docusaurus-types`, `docusaurus`
- [#5841](https://github.com/facebook/docusaurus/pull/5841) feat: allow user to specify deploymentBranch property in docusaurus.config.js ([@wpyoga](https://github.com/wpyoga))
- `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-search-algolia`
- [#5795](https://github.com/facebook/docusaurus/pull/5795) feat(search-algolia): algolia externalUrl regex to navigate with window.href ([@semoal](https://github.com/semoal))
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-pwa`, `docusaurus-types`, `docusaurus`
- [#5814](https://github.com/facebook/docusaurus/pull/5814) feat: Support Node 17 ([@slorber](https://github.com/slorber))
- [#5420](https://github.com/facebook/docusaurus/pull/5420) feat(core): upgrade to webpack-dev-server@4 ([@AviVahl](https://github.com/AviVahl))
- `docusaurus-theme-classic`
- [#5791](https://github.com/facebook/docusaurus/pull/5791) feat(theme-classic): add Serbian Cyrillic translation ([@utajum](https://github.com/utajum))
#### :boom: Breaking Change
- `create-docusaurus`, `docusaurus-mdx-loader`, `docusaurus-migrate`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-debug`, `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-sitemap`, `docusaurus-preset-classic`, `docusaurus-remark-plugin-npm2yarn`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-theme-search-algolia`, `docusaurus-utils-common`, `docusaurus-utils-validation`, `docusaurus-utils`, `docusaurus`, `lqip-loader`
- [#5812](https://github.com/facebook/docusaurus/pull/5812) chore: require Node 14 ([@slorber](https://github.com/slorber))
#### :bug: Bug Fix
- `docusaurus-plugin-content-blog`
- [#5835](https://github.com/facebook/docusaurus/pull/5835) fix(content-blog): Fix blog feeds not generated ([@slorber](https://github.com/slorber))
- `docusaurus`
- [#5828](https://github.com/facebook/docusaurus/pull/5828) fix: include all branch tips for shallow clone in deploy command ([@sivapalan](https://github.com/sivapalan))
- [#5824](https://github.com/facebook/docusaurus/pull/5824) fix: baseUrl passed to sortConfig ([@semoal](https://github.com/semoal))
- [#5813](https://github.com/facebook/docusaurus/pull/5813) fix: handle SIGTERM in build command ([@slorber](https://github.com/slorber))
- `docusaurus-module-type-aliases`, `docusaurus`
- [#5819](https://github.com/facebook/docusaurus/pull/5819) fix: use @docusaurus/react-loadable as package alias + include types ([@slorber](https://github.com/slorber))
#### :nail_care: Polish
- `docusaurus-preset-classic`
- [#5831](https://github.com/facebook/docusaurus/pull/5831) feat(preset-classic): guard against unknown keys in options ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus`
- [#5815](https://github.com/facebook/docusaurus/pull/5815) refactor: some improvements for webpack-dev-server ([@lex111](https://github.com/lex111))
- `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-utils`, `docusaurus`
- [#5788](https://github.com/facebook/docusaurus/pull/5788) refactor: fix a few type inconsistencies ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`
- [#5781](https://github.com/facebook/docusaurus/pull/5781) refactor: Vietnamese translations ([@datlechin](https://github.com/datlechin))
#### :memo: Documentation
- Other
- [#5853](https://github.com/facebook/docusaurus/pull/5853) docs: Fix a typo in CONTRIBUTING.md ([@fishmandev](https://github.com/fishmandev))
- [#5852](https://github.com/facebook/docusaurus/pull/5852) docs: Fix a typo in versioning.md ([@fishmandev](https://github.com/fishmandev))
- [#5847](https://github.com/facebook/docusaurus/pull/5847) docs: add InfraQL product docs website to showcase ([@jeffreyaven](https://github.com/jeffreyaven))
- [#5843](https://github.com/facebook/docusaurus/pull/5843) docs: fix i18n routes to feature requests ([@Josh-Cena](https://github.com/Josh-Cena))
- [#5766](https://github.com/facebook/docusaurus/pull/5766) docs: elaborate on the usage of MDX plugins ([@cerkiewny](https://github.com/cerkiewny))
- [#5826](https://github.com/facebook/docusaurus/pull/5826) docs: fix lint issue ([@slorber](https://github.com/slorber))
- [#5801](https://github.com/facebook/docusaurus/pull/5801) docs: Update Drone Deployment docs ([@gabrielfalcao](https://github.com/gabrielfalcao))
- [#5821](https://github.com/facebook/docusaurus/pull/5821) docs: include navbar item type in the API table ([@Josh-Cena](https://github.com/Josh-Cena))
- [#5820](https://github.com/facebook/docusaurus/pull/5820) docs: add @Josh-Cena to the team ([@Josh-Cena](https://github.com/Josh-Cena))
- [#5818](https://github.com/facebook/docusaurus/pull/5818) doc: fix typo in "create a doc" ([@dominikmeyersap](https://github.com/dominikmeyersap))
- [#5797](https://github.com/facebook/docusaurus/pull/5797) docs: use "npx create-docusaurus" for init ([@slorber](https://github.com/slorber))
- [#5771](https://github.com/facebook/docusaurus/pull/5771) docs: Minor update to grammar in plugins overview page ([@robbieaverill](https://github.com/robbieaverill))
- [#5774](https://github.com/facebook/docusaurus/pull/5774) docs: update ssrTemplate ([@juzhiyuan](https://github.com/juzhiyuan))
- [#5784](https://github.com/facebook/docusaurus/pull/5784) docs: fix link for apply to DocSearch program ([@lex111](https://github.com/lex111))
- `create-docusaurus`
- [#5792](https://github.com/facebook/docusaurus/pull/5792) docs: fix typo ([@wingclover](https://github.com/wingclover))
#### :house: Internal
- Other
- [#5842](https://github.com/facebook/docusaurus/pull/5842) misc: add "name" field for root package.json ([@wpyoga](https://github.com/wpyoga))
- [#5836](https://github.com/facebook/docusaurus/pull/5836) chore: switch to GitHub issue forms ([@lex111](https://github.com/lex111))
- [#5834](https://github.com/facebook/docusaurus/pull/5834) chore(issue templ): add "self service" section in templates ([@Josh-Cena](https://github.com/Josh-Cena))
- [#5833](https://github.com/facebook/docusaurus/pull/5833) chore(workflow): remove v2 prefix from titles ([@Josh-Cena](https://github.com/Josh-Cena))
- [#5697](https://github.com/facebook/docusaurus/pull/5697) chore(workflow): add cache to workflows using actions/setup-node ([@oscard0m](https://github.com/oscard0m))
- [#5825](https://github.com/facebook/docusaurus/pull/5825) chore: fix Crowdin again ([@slorber](https://github.com/slorber))
- [#5823](https://github.com/facebook/docusaurus/pull/5823) chore: replace doc sample .pdf file by .xlsx to solve Crowdin issue ([@slorber](https://github.com/slorber))
- [#5763](https://github.com/facebook/docusaurus/pull/5763) chore: update examples for beta.8 ([@slorber](https://github.com/slorber))
- `create-docusaurus`, `docusaurus-mdx-loader`, `docusaurus-migrate`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-debug`, `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-sitemap`, `docusaurus-preset-classic`, `docusaurus-remark-plugin-npm2yarn`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-theme-search-algolia`, `docusaurus-utils-common`, `docusaurus-utils-validation`, `docusaurus-utils`, `docusaurus`, `lqip-loader`
- [#5812](https://github.com/facebook/docusaurus/pull/5812) chore: require Node 14 ([@slorber](https://github.com/slorber))
- `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-theme-classic`, `docusaurus`
- [#5807](https://github.com/facebook/docusaurus/pull/5807) refactor: remove a few Lodash usages & ESLint enforcement ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-module-type-aliases`, `docusaurus-plugin-client-redirects`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-utils`, `docusaurus`
- [#5808](https://github.com/facebook/docusaurus/pull/5808) refactor: clear a few ESLint warnings ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `lqip-loader`
- [#5779](https://github.com/facebook/docusaurus/pull/5779) refactor: migrate lqip-loader to TS, fix typing for Webpack Loaders ([@Josh-Cena](https://github.com/Josh-Cena))
#### Committers: 18
- Alexey Pyltsyn ([@lex111](https://github.com/lex111))
- Avi Vahl ([@AviVahl](https://github.com/AviVahl))
- Devtato ([@cerkiewny](https://github.com/cerkiewny))
- Dmitriy Fishman ([@fishmandev](https://github.com/fishmandev))
- Dominik Meyer ([@dominikmeyersap](https://github.com/dominikmeyersap))
- Gabriel Falcão ([@gabrielfalcao](https://github.com/gabrielfalcao))
- Jeffrey Aven ([@jeffreyaven](https://github.com/jeffreyaven))
- Joshua Chen ([@Josh-Cena](https://github.com/Josh-Cena))
- Ngô Quốc Đạt ([@datlechin](https://github.com/datlechin))
- Oscar Dominguez ([@oscard0m](https://github.com/oscard0m))
- Robbie Averill ([@robbieaverill](https://github.com/robbieaverill))
- Sergio Moreno ([@semoal](https://github.com/semoal))
- Sébastien Lorber ([@slorber](https://github.com/slorber))
- Varun Sivapalan ([@sivapalan](https://github.com/sivapalan))
- Vladimir Tasic ([@utajum](https://github.com/utajum))
- William Poetra Yoga ([@wpyoga](https://github.com/wpyoga))
- Ying Wang ([@wingclover](https://github.com/wingclover))
- 琚致远 ([@juzhiyuan](https://github.com/juzhiyuan))
## 2.0.0-beta.8 (2021-10-21)
#### :rocket: New Feature

View file

@ -1,6 +1,6 @@
{
"name": "new.docusaurus.io",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"private": true,
"scripts": {
"start": "netlify dev"

View file

@ -1,5 +1,5 @@
{
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"npmClient": "yarn",
"useWorkspaces": true,
"changelog": {

View file

@ -1,6 +1,6 @@
{
"name": "create-docusaurus",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Create Docusaurus apps easily.",
"repository": {
"type": "git",

View file

@ -1,6 +1,6 @@
{
"name": "docusaurus-2-classic-typescript-template",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@ -15,8 +15,8 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/preset-classic": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/preset-classic": "2.0.0-beta.9",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",
@ -27,7 +27,7 @@
"url-loader": "^4.1.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.8",
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
"@tsconfig/docusaurus": "^1.0.4",
"typescript": "^4.3.5"
},

View file

@ -1,6 +1,6 @@
{
"name": "docusaurus-2-classic-template",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@ -14,8 +14,8 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/preset-classic": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/preset-classic": "2.0.0-beta.9",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",

View file

@ -1,6 +1,6 @@
{
"name": "docusaurus-2-facebook-template",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@ -18,8 +18,8 @@
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,md,mdx}\""
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/preset-classic": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/preset-classic": "2.0.0-beta.9",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/cssnano-preset",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Advanced cssnano preset for maximum optimization.",
"main": "index.js",
"license": "MIT",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/mdx-loader",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Docusaurus Loader for MDX",
"main": "lib/index.js",
"types": "src/types.d.ts",
@ -20,8 +20,8 @@
"dependencies": {
"@babel/parser": "^7.12.16",
"@babel/traverse": "^7.12.13",
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@mdx-js/mdx": "^1.6.21",
"@mdx-js/react": "^1.6.21",
"chalk": "^4.1.2",
@ -38,7 +38,7 @@
"webpack": "^5.61.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.9",
"@types/escape-html": "^1.0.1",
"@types/mdast": "^3.0.7",
"@types/stringify-object": "^3.3.1",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/migrate",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "A CLI tool to migrate from older versions of Docusaurus.",
"main": "lib/index.js",
"license": "MIT",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/module-type-aliases",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Docusaurus module type aliases.",
"types": "./src/index.d.ts",
"publishConfig": {

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-client-redirects",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Client redirects plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-client-redirects.d.ts",
@ -18,11 +18,11 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-common": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/types": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-common": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"chalk": "^4.1.2",
"eta": "^1.12.3",
"fs-extra": "^10.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-blog",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Blog plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-content-blog.d.ts",
@ -18,11 +18,11 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/mdx-loader": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/mdx-loader": "2.0.0-beta.9",
"@docusaurus/types": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"chalk": "^4.1.2",
"escape-string-regexp": "^4.0.0",
"feed": "^4.2.2",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-docs",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Docs plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-content-docs.d.ts",
@ -18,7 +18,7 @@
},
"license": "MIT",
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.8",
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
"@types/js-yaml": "^4.0.0",
"@types/picomatch": "^2.2.1",
"commander": "^5.1.0",
@ -26,11 +26,11 @@
"utility-types": "^3.10.0"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/mdx-loader": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/mdx-loader": "2.0.0-beta.9",
"@docusaurus/types": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"chalk": "^4.1.2",
"combine-promises": "^1.1.0",
"escape-string-regexp": "^4.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-pages",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"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": "2.0.0-beta.8",
"@docusaurus/mdx-loader": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/mdx-loader": "2.0.0-beta.9",
"@docusaurus/types": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"globby": "^11.0.2",
"lodash": "^4.17.20",
"remark-admonitions": "^1.2.1",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-debug",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Debug plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/types.d.ts",
@ -18,9 +18,9 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/types": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"fs-extra": "^10.0.0",
"react-json-view": "^1.21.3",
"tslib": "^2.3.1"

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-google-analytics",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Global analytics (analytics.js) plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-google-analytics.d.ts",
@ -18,10 +18,10 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8"
"@docusaurus/core": "2.0.0-beta.9"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.8"
"@docusaurus/types": "2.0.0-beta.9"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-google-gtag",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Global Site Tag (gtag.js) plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-google-gtag.d.ts",
@ -18,10 +18,10 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8"
"@docusaurus/core": "2.0.0-beta.9"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.8"
"@docusaurus/types": "2.0.0-beta.9"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-ideal-image",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"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",
@ -21,10 +21,10 @@
"fs-extra": "^10.0.0"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/lqip-loader": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/lqip-loader": "2.0.0-beta.9",
"@docusaurus/responsive-loader": "1.4.0",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.9",
"@endiliey/react-ideal-image": "^0.0.11",
"react-waypoint": "^10.1.0",
"sharp": "^0.29.1",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-pwa",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Docusaurus Plugin to add PWA support.",
"main": "src/index.js",
"publishConfig": {
@ -16,10 +16,10 @@
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13",
"@babel/plugin-proposal-optional-chaining": "^7.12.16",
"@babel/preset-env": "^7.15.6",
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/theme-common": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/theme-common": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"babel-loader": "^8.2.2",
"clsx": "^1.1.1",
"core-js": "^2.6.5",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-sitemap",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Simple sitemap generation plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-sitemap.d.ts",
@ -18,11 +18,11 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-common": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/types": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-common": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"fs-extra": "^10.0.0",
"sitemap": "^7.0.0",
"tslib": "^2.3.1"

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/preset-classic",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Classic preset for Docusaurus.",
"main": "lib/index.js",
"types": "src/preset-classic.d.ts",
@ -18,16 +18,16 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/plugin-content-blog": "2.0.0-beta.8",
"@docusaurus/plugin-content-docs": "2.0.0-beta.8",
"@docusaurus/plugin-content-pages": "2.0.0-beta.8",
"@docusaurus/plugin-debug": "2.0.0-beta.8",
"@docusaurus/plugin-google-analytics": "2.0.0-beta.8",
"@docusaurus/plugin-google-gtag": "2.0.0-beta.8",
"@docusaurus/plugin-sitemap": "2.0.0-beta.8",
"@docusaurus/theme-classic": "2.0.0-beta.8",
"@docusaurus/theme-search-algolia": "2.0.0-beta.8"
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/plugin-content-blog": "2.0.0-beta.9",
"@docusaurus/plugin-content-docs": "2.0.0-beta.9",
"@docusaurus/plugin-content-pages": "2.0.0-beta.9",
"@docusaurus/plugin-debug": "2.0.0-beta.9",
"@docusaurus/plugin-google-analytics": "2.0.0-beta.9",
"@docusaurus/plugin-google-gtag": "2.0.0-beta.9",
"@docusaurus/plugin-sitemap": "2.0.0-beta.9",
"@docusaurus/theme-classic": "2.0.0-beta.9",
"@docusaurus/theme-search-algolia": "2.0.0-beta.9"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-classic",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Classic theme for Docusaurus",
"main": "lib/index.js",
"types": "src/types.d.ts",
@ -23,15 +23,15 @@
"update-code-translations": "node -e 'require(\"./update-code-translations.js\").run()'"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/plugin-content-blog": "2.0.0-beta.8",
"@docusaurus/plugin-content-docs": "2.0.0-beta.8",
"@docusaurus/plugin-content-pages": "2.0.0-beta.8",
"@docusaurus/theme-common": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-common": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/plugin-content-blog": "2.0.0-beta.9",
"@docusaurus/plugin-content-docs": "2.0.0-beta.9",
"@docusaurus/plugin-content-pages": "2.0.0-beta.9",
"@docusaurus/theme-common": "2.0.0-beta.9",
"@docusaurus/types": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-common": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"@mdx-js/mdx": "^1.6.21",
"@mdx-js/react": "^1.6.21",
"chalk": "^4.1.2",
@ -50,7 +50,7 @@
"rtlcss": "^3.3.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.8",
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
"@types/mdx-js__react": "^1.5.4",
"@types/parse-numeric-range": "^0.0.1",
"@types/rtlcss": "^3.1.1",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-common",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Common code for Docusaurus themes.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
@ -18,18 +18,18 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/plugin-content-blog": "2.0.0-beta.8",
"@docusaurus/plugin-content-docs": "2.0.0-beta.8",
"@docusaurus/plugin-content-pages": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/plugin-content-blog": "2.0.0-beta.9",
"@docusaurus/plugin-content-docs": "2.0.0-beta.9",
"@docusaurus/plugin-content-pages": "2.0.0-beta.9",
"@docusaurus/types": "2.0.0-beta.9",
"clsx": "^1.1.1",
"fs-extra": "^10.0.0",
"tslib": "^2.3.1",
"utility-types": "^3.10.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.8",
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
"lodash": "^4.17.20"
},
"peerDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-live-codeblock",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Docusaurus live code block component.",
"main": "lib/index.js",
"publishConfig": {
@ -17,8 +17,8 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"@philpl/buble": "^0.19.7",
"clsx": "^1.1.1",
"fs-extra": "^10.0.0",
@ -27,7 +27,7 @@
"react-live": "2.2.3"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.9",
"@types/buble": "^0.20.1"
},
"peerDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-search-algolia",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Algolia search component for Docusaurus.",
"main": "src/index.js",
"publishConfig": {
@ -14,10 +14,10 @@
"license": "MIT",
"dependencies": {
"@docsearch/react": "^3.0.0-alpha.39",
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/theme-common": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/theme-common": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"algoliasearch": "^4.10.5",
"algoliasearch-helper": "^3.5.5",
"clsx": "^1.1.1",

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/utils-common",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Common (Node/Browser) utility functions for Docusaurus packages.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
@ -18,7 +18,7 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.9",
"tslib": "^2.3.1"
},
"engines": {

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/utils-validation",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Node validation utility functions for Docusaurus packages.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
@ -18,7 +18,7 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.9",
"chalk": "^4.1.2",
"joi": "^17.4.2",
"tslib": "^2.3.1"

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/utils",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Node utility functions for Docusaurus packages.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
@ -18,7 +18,7 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.9",
"@mdx-js/runtime": "^1.6.22",
"@types/github-slugger": "^1.3.0",
"chalk": "^4.1.2",

View file

@ -1,7 +1,7 @@
{
"name": "@docusaurus/core",
"description": "Easy to Maintain Open Source Documentation Websites",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"license": "MIT",
"publishConfig": {
"access": "public"
@ -31,7 +31,7 @@
"url": "https://github.com/facebook/docusaurus/issues"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.8",
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
"@types/copy-webpack-plugin": "^8.0.1",
"@types/css-minimizer-webpack-plugin": "^3.0.2",
"@types/detect-port": "^1.3.0",
@ -54,12 +54,12 @@
"@babel/runtime": "^7.15.4",
"@babel/runtime-corejs3": "^7.15.4",
"@babel/traverse": "^7.12.13",
"@docusaurus/cssnano-preset": "2.0.0-beta.8",
"@docusaurus/cssnano-preset": "2.0.0-beta.9",
"@docusaurus/react-loadable": "5.5.2",
"@docusaurus/types": "2.0.0-beta.8",
"@docusaurus/utils": "2.0.0-beta.8",
"@docusaurus/utils-common": "2.0.0-beta.8",
"@docusaurus/utils-validation": "2.0.0-beta.8",
"@docusaurus/types": "2.0.0-beta.9",
"@docusaurus/utils": "2.0.0-beta.9",
"@docusaurus/utils-common": "2.0.0-beta.9",
"@docusaurus/utils-validation": "2.0.0-beta.9",
"@slorber/static-site-generator-webpack-plugin": "^4.0.0",
"@svgr/webpack": "^5.5.0",
"autoprefixer": "^10.3.5",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/lqip-loader",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Low Quality Image Placeholders (LQIP) loader for webpack.",
"main": "lib/index.js",
"publishConfig": {

View file

@ -1,6 +1,6 @@
{
"name": "stylelint-copyright",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Stylelint plugin to check CSS files for a copyright header.",
"main": "index.js",
"license": "MIT",

View file

@ -1,6 +1,6 @@
{
"name": "website",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@ -31,13 +31,13 @@
"dependencies": {
"@crowdin/cli": "^3.7.1",
"@crowdin/crowdin-api-client": "^1.10.6",
"@docusaurus/core": "2.0.0-beta.8",
"@docusaurus/plugin-client-redirects": "2.0.0-beta.8",
"@docusaurus/plugin-ideal-image": "2.0.0-beta.8",
"@docusaurus/plugin-pwa": "2.0.0-beta.8",
"@docusaurus/preset-classic": "2.0.0-beta.8",
"@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.8",
"@docusaurus/theme-live-codeblock": "2.0.0-beta.8",
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/plugin-client-redirects": "2.0.0-beta.9",
"@docusaurus/plugin-ideal-image": "2.0.0-beta.9",
"@docusaurus/plugin-pwa": "2.0.0-beta.9",
"@docusaurus/preset-classic": "2.0.0-beta.9",
"@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.9",
"@docusaurus/theme-live-codeblock": "2.0.0-beta.9",
"clsx": "^1.1.1",
"color": "^4.0.1",
"esbuild-loader": "2.13.1",

View file

@ -1,78 +0,0 @@
---
id: plugins
title: Plugins
description: Using MDX plugins to expand Docusaurus Markdown functionalities
slug: /markdown-features/plugins
---
You can expand the MDX functionalities, using plugins.
Docusaurus content plugins support both [Remark](https://github.com/remarkjs/remark) and [Rehype](https://github.com/rehypejs/rehype) plugins that work with MDX.
## Configuring plugins {#configuring-plugins}
An MDX plugin is usually a npm package, so you install them like other npm packages using npm.
First, install your [Remark](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) and [Rehype](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) plugins.
For example:
```bash npm2yarn
npm install --save remark-images
npm install --save rehype-truncate
```
Next, import the plugins:
```js
const remarkImages = require('remark-images');
const rehypeTruncate = require('rehype-truncate');
```
Finally, add them to the `@docusaurus/preset-classic` options in `docusaurus.config.js`:
```js {10,11} title="docusaurus.config.js"
module.exports = {
// ...
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// ...
remarkPlugins: [remarkImages],
rehypePlugins: [rehypeTruncate],
},
},
],
],
};
```
## Configuring plugin options {#configuring-plugin-options}
Some plugins can be configured and accept their own options. In that case, use the `[plugin, pluginOptions]` syntax, like so:
```jsx {10-13} title="docusaurus.config.js"
module.exports = {
// ...
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// ...
remarkPlugins: [
plugin1,
[plugin2, {option1: {...}}],
],
},
},
],
],
};
```
See more information in the [MDX documentation](https://mdxjs.com/advanced/plugins).

View file

@ -194,6 +194,18 @@ module.exports = {
};
```
### `deploymentBranch` {#deploymentbranch}
- Type: `string`
The name of the branch to deploy the static files to. Used by the deployment command.
```js title="docusaurus.config.js"
module.exports = {
deploymentBranch: 'gh-pages',
};
```
### `githubHost` {#githubhost}
- Type: `string`
@ -252,6 +264,8 @@ module.exports = {
logo: {
alt: 'Site Logo',
src: 'img/logo.svg',
width: 32,
height: 32,
},
items: [
{
@ -280,6 +294,8 @@ module.exports = {
logo: {
alt: 'Facebook Open Source Logo',
src: 'https://docusaurus.io/img/oss_logo.png',
width: 160,
height: 51,
},
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`, // You can also put own HTML here
},
@ -399,8 +415,11 @@ module.exports = {
<html <%~ it.htmlAttributes %>>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=3.0, minimum-scale=0.86">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Docusaurus v<%= it.version %>">
<% if (it.noIndex) { %>
<meta name="robots" content="noindex, nofollow" />
<% } %>
<%~ it.headTags %>
<% it.metaAttributes.forEach((metaAttribute) => { %>
<%~ metaAttribute %>
@ -412,20 +431,17 @@ module.exports = {
<link rel="preload" href="<%= it.baseUrl %><%= script %>" as="script">
<% }); %>
</head>
<body <%~ it.bodyAttributes %> itemscope="" itemtype="http://schema.org/Organization">
<body <%~ it.bodyAttributes %>>
<%~ it.preBodyTags %>
<div id="__docusaurus">
<%~ it.appHtml %>
</div>
<div id="outside-docusaurus">
<span>Custom markup</span>
</div>
<% it.scripts.forEach((script) => { %>
<script src="<%= it.baseUrl %><%= script %>"></script>
<% }); %>
<%~ it.postBodyTags %>
</body>
</html>
</html>`,
};
```

View file

@ -9,7 +9,7 @@ We provide official Docusaurus plugins.
## Content plugins {#content-plugins}
These plugins are responsible to load your site's content, and create pages for your theme to render.
These plugins are responsible for loading your site's content, and creating pages for your theme to render.
- [@docusaurus/plugin-content-docs](./plugin-content-docs.md)
- [@docusaurus/plugin-content-blog](./plugin-content-blog.md)

View file

@ -51,6 +51,7 @@ Accepted fields:
| `beforeDefaultRehypePlugins` | `any[]` | `[]` | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins. |
| `truncateMarker` | `string` | `/<!--\s*(truncate)\s*-->/` | Truncate marker, can be a regex or string. |
| `showReadingTime` | `boolean` | `true` | Show estimated reading time for the blog post. |
| `readingTime` | `ReadingTimeFunctionOption` | The default reading time | A callback to customize the reading time number displayed. |
| `authorsMapPath` | `string` | `'authors.yml'` | Path to the authors map file, relative to the blog content directory specified with `path`. Can also be a `json` file. |
| `feedOptions` | _See below_ | `{type: ['rss', 'atom']}` | Blog feed. If undefined, no rss feed will be generated. |
| `feedOptions.type` | <code>'rss' \| 'atom' \| 'all'</code> (or array of multiple options) | **Required** | Type of feed to be generated. |
@ -68,6 +69,23 @@ type EditUrlFunction = (params: {
permalink: string;
locale: string;
}) => string | undefined;
type ReadingTimeOptions = {
wordsPerMinute: number;
wordBound: (char: string) => boolean;
};
type ReadingTimeFunction = (params: {
content: string;
frontMatter?: BlogPostFrontMatter & Record<string, unknown>;
options?: ReadingTimeOptions;
}) => number;
type ReadingTimeFunctionOption = (params: {
content: string;
frontMatter: BlogPostFrontMatter & Record<string, unknown>;
defaultReadingTime: ReadingTimeFunction;
}) => number | undefined;
```
## Example configuration {#ex-config}

View file

@ -252,6 +252,8 @@ Accepted fields:
| `hide_table_of_contents` | `boolean` | `false` | Whether to hide the table of contents to the right. |
| `toc_min_heading_level` | `number` | `2` | The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value. |
| `toc_max_heading_level` | `number` | `3` | The max heading level shown in the table of contents. Must be between 2 and 6. |
| `pagination_next` | <code>string \| null</code> | Next doc in the sidebar | The ID of the documentation you want the "Next" pagination to link to. Use `null` to disable showing "Next" for this page. |
| `pagination_prev` | <code>string \| null</code> | Previous doc in the sidebar | The ID of the documentation you want the "Previous" pagination to link to. Use `null` to disable showing "Previous" for this page. |
| `parse_number_prefixes` | `boolean` | `numberPrefixParser` plugin option | Whether number prefix parsing is disabled on this doc. See also [Using number prefixes](/docs/sidebar#using-number-prefixes). |
| `custom_edit_url` | `string` | Computed using the `editUrl` plugin option | The URL for editing this document. |
| `keywords` | `string[]` | `undefined` | Keywords meta tag for the document page, for search engines. |

View file

@ -187,6 +187,8 @@ Accepted fields:
| `src` | `string` | **Required** | URL to the logo image. Base URL is appended by default. |
| `srcDark` | `string` | `logo.src` | An alternative image URL to use in dark mode. |
| `href` | `string` | `siteConfig.baseUrl` | Link to navigate to when the logo is clicked. |
| `width` | <code>string \| number</code> | `undefined` | Specifies the `width` attribute. |
| `height` | <code>string \| number</code> | `undefined` | Specifies the `height` attribute. |
| `target` | `string` | Calculated based on `href` (external links will open in a new tab, all others in the current one). | The `target` attribute of the link; controls whether the link is opened in a new tab, the current one, or otherwise. |
</small>
@ -205,6 +207,8 @@ module.exports = {
srcDark: 'img/logo_dark.svg',
href: 'https://docusaurus.io/',
target: '_self',
width: 32,
height: 32,
},
// highlight-end
},
@ -679,6 +683,8 @@ module.exports = {
alt: 'Facebook Open Source Logo',
src: 'img/oss_logo.png',
href: 'https://opensource.facebook.com',
width: 160,
height: 51,
},
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},

View file

@ -335,6 +335,124 @@ website/i18n/<locale>/docusaurus-plugin-content-blog/authors.yml
:::
## Reading time {#reading-time}
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 = {
presets: [
[
'@docusaurus/preset-classic',
{
blog: {
// highlight-start
showReadingTime: true, // When set to false, the "x min read" won't be shown
readingTime: ({content, frontMatter, defaultReadingTime}) =>
defaultReadingTime({content, options: {wordsPerMinute: 300}}),
// highlight-end
},
},
],
],
};
```
The `readingTime` callback receives three parameters: the blog content text as a string, front matter as a record of string keys and their values, and the default reading time function. It returns a number (reading time in minutes) or `undefined` (disable reading time for this page).
The default reading time is able to accept additional options: `wordsPerMinute` as a number (default: 300), and `wordBound` as a function from string to boolean. If the string passed to `wordBound` should be a word bound (spaces, tabs, and line breaks by default), the function should return `true`.
:::tip
Use the callback for all your customization needs:
````mdx-code-block
<Tabs>
<TabItem value="disable-per-post" label="Per-post disabling">
**Disable reading time on one page:**
```js title="docusaurus.config.js"
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
blog: {
showReadingTime: true,
// highlight-start
readingTime: ({content, frontMatter, defaultReadingTime}) =>
frontMatter.hide_reading_time ? undefined : defaultReadingTime({content}),
// highlight-end
},
},
],
],
};
```
Usage:
```yml "my-blog-post.md"
---
hide_reading_time: true
---
This page will no longer display the reading time stats!
```
</TabItem>
<TabItem value="passing-options" label="Passing options">
**Pass options to the default reading time function:**
```js title="docusaurus.config.js"
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
blog: {
// highlight-start
readingTime: ({content, defaultReadingTime}) =>
defaultReadingTime({content, options: {wordsPerMinute: 100}}),
// highlight-end
},
},
],
],
};
```
</TabItem>
<TabItem value="using-custom-algo" label="Using custom algorithms">
**Use a custom implementation of reading time:**
```js title="docusaurus.config.js"
const myReadingTime = require('./myReadingTime');
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
blog: {
// highlight-next-line
readingTime: ({content}) => myReadingTime(content),
},
},
],
],
};
```
</TabItem>
</Tabs>
````
:::
## Feed {#feed}
You can generate RSS/Atom feed by passing feedOptions. By default, RSS and Atom feeds are generated. To disable feed generation, set `feedOptions.type` to `null`.

View file

@ -183,6 +183,12 @@ By default, the files are written in `website/i18n/<defaultLocale>/...`.
| `--config` | `undefined` | Path to docusaurus config file, default to `[siteDir]/docusaurus.config.js` |
| `--messagePrefix` | `''` | Allows to add a prefix to each translation message, to help you highlight untranslated strings |
### `docusaurus write-heading-ids [siteDir]` {#docusaurus-write-heading-ids-sitedir}
### `docusaurus write-heading-ids [siteDir] [files]` {#docusaurus-write-heading-ids-sitedir}
Add [explicit heading ids](./guides/markdown-features/markdown-features-headings.mdx#explicit-ids) to the Markdown documents of your site.
| Name | Default | Description |
| --- | --- | --- |
| `files` | All MD files used by plugins | The files that you want heading IDs to be written to. |
| `--maintain-case` | `false` | Keep the headings' casing, otherwise make all lowercase. |
| `--overwrite` | `false` | Overwrite existing heading IDs. |

View file

@ -29,7 +29,7 @@ They are used in a number of places such as your site's title and headings, brow
### Deployment configurations {#deployment-configurations}
Deployment configurations such as `projectName` and `organizationName` are used when you deploy your site with the `deploy` command.
Deployment configurations such as `projectName`, `organizationName`, and optionally `deploymentBranch` are used when you deploy your site with the `deploy` command.
It is recommended to check the [deployment docs](deployment.mdx) for more information.

View file

@ -75,6 +75,7 @@ First, modify your `docusaurus.config.js` and add the required params:
| --- | --- |
| `organizationName` | The GitHub user or organization that owns the repository. If you are the owner, it is your GitHub username. In the case of Docusaurus, it is "_facebook_" which is the GitHub organization that owns Docusaurus. |
| `projectName` | The name of the GitHub repository. For example, the repository name for Docusaurus is "docusaurus", so the project name is "docusaurus". |
| `deploymentBranch` | The name of the branch to deploy the static files to. This defaults to "gh-pages" for non-organization GitHub Pages repos. If the repo name ends in ".github.io", you have to either specify this property or set the environment variable `DEPLOYMENT_BRANCH`. |
| `url` | URL for your GitHub Page's user/organization page. This is commonly https://_username_.github.io. |
| `baseUrl` | Base URL for your project. For projects hosted on GitHub pages, it follows the format "/_projectName_/". For https://github.com/facebook/docusaurus, `baseUrl` is `/docusaurus/`. |
@ -127,7 +128,7 @@ Optional parameters, also set as environment variables:
| Name | Description |
| --- | --- |
| `USE_SSH` | Set to `true` to use SSH instead of the default HTTPS for the connection to the GitHub repo. |
| `DEPLOYMENT_BRANCH` | The branch that the website will be deployed to, defaults to `gh-pages`. For GitHub Pages Organization repos (`config.projectName` ending in `github.io`), this env variable is required. |
| `DEPLOYMENT_BRANCH` | The branch that the website will be deployed to, defaults to `gh-pages`. For GitHub Pages Organization repos (`config.projectName` ending in `github.io`), you need to either set this env variable or specify the `deploymentBranch` param in `docusaurus.config.js`. |
| `CURRENT_BRANCH` | The branch that contains the latest docs changes that will be deployed. Usually, the branch will be `main`, but it could be any branch (default or otherwise) except for `gh-pages`. If nothing is set for this variable, then the current branch will be used. |
| `GIT_PASS` | Password (or token) of the `git` user (specified by `GIT_USER`). For example, to facilitate non-interactive deployment (e.g. continuous deployment) |
@ -354,15 +355,16 @@ trigger:
commands:
- mkdir -p $HOME/.ssh
- ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
- echo "$GITHUB_PRIVATE_KEY > $HOME/.ssh/id_rsa"
- echo "$GITHUB_PRIVATE_KEY" > "$HOME/.ssh/id_rsa"
- chmod 0600 $HOME/.ssh/id_rsa
- cd website
- npm i
- npm run publish-gh-pages
- npm run deploy
environment:
USE_SSH: true
GIT_USER: $DRONE_COMMIT_AUTHOR
GITHUB_PRIVATE_KEY: git_deploy_private_key
GITHUB_PRIVATE_KEY:
from_secret: "git_deploy_private_key"
```
Now, whenever you push a new tag to github, this trigger will start the drone ci job to publish your website.

View file

@ -112,7 +112,7 @@ tags:
:::tip
Tags can also be declared with `tags [Demo, Getting started]`
Tags can also be declared with `tags: [Demo, Getting started]`.
Read more about all the possible [Yaml array syntaxes](https://www.w3schools.io/file/yaml-arrays/).

View file

@ -1,6 +1,7 @@
---
id: sidebar
title: Sidebar
toc_max_heading_level: 4
slug: /sidebar
---

View file

@ -184,7 +184,7 @@ Should you cut a new documentation version 1.0.1? **You probably shouldn't**. 1.
### Keep the number of versions small {#keep-the-number-of-versions-small}
As a good rule of thumb, try to keep the number of your versions below 10. **It is very likely** that you will have a lot of obsolete versioned documentation that nobody even reads anymore. For example, [Jest](https://jestjs.io/versions) is currently in version `24.9`, and only maintains several latest documentation version with the lowest being `22.X`. Keep it small 😊
As a good rule of thumb, try to keep the number of your versions below 10. **It is very likely** that you will have a lot of obsolete versioned documentation that nobody even reads anymore. For example, [Jest](https://jestjs.io/versions) is currently in version `24.9`, and only maintains several latest documentation versions with the lowest being `22.X`. Keep it small 😊
### Use absolute import within the docs {#use-absolute-import-within-the-docs}

View file

@ -0,0 +1,198 @@
---
id: plugins
title: MDX Plugins
description: Using MDX plugins to expand Docusaurus Markdown functionalities
slug: /markdown-features/plugins
---
Sometimes, you may want to extend or tweak your Markdown syntax. For example:
- How do I embed youtube videos using the image syntax (`![](https://youtu.be/yKNxeF4KMsY)`)?
- How do I style links that are on its own line differently, e.g., like a social card?
- How do I make every page start with a copyright notice?
And the answer is: create an MDX plugin! MDX has a built-in [plugin system](https://mdxjs.com/advanced/plugins/) that can be used to customize how the Markdown files will be parsed and transformed to JSX. There are three typical use-cases of MDX plugins:
- Using existing [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) or [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins);
- Creating remark/rehype plugins to tranform the elements generated by existing MDX syntax;
- Creating remark/rehype plugins to introduce new syntaxes to MDX.
If you play with the [MDX playground](https://mdx-git-renovate-babel-monorepo-mdx.vercel.app/playground), you would notice that the MDX transpilation has two intermediate steps: Markdown AST (MDAST), and Hypertext AST (HAST), before arriving at the final JSX output. MDX plugins also come in two forms:
- **[Remark](https://github.com/remarkjs/remark/)**: processes the Markdown AST.
- **[Rehype](https://github.com/rehypejs/rehype/)**: processes the Hypertext AST.
:::tip
Use plugins to introduce shorter syntax for the most commonly used JSX elements in your project. The [admonition](./markdown-features-admonitions.mdx) syntax that we offer is also generated by a [Remark plugin](https://github.com/elviswolcott/remark-admonitions), and you could do the same for your own use-case.
:::
## Default plugins {#default-plugins}
Docusaurus injects [some default Remark plugins](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-mdx-loader/src/remark) during Markdown processing. These plugins would:
- Generate the table of contents;
- Add anchor links to each heading;
- Transform images and links to `require()` calls.
- …
These are all typical use-cases of Remark plugins, which can also be a source of inspiration if you want to implement your own plugin.
## Installing plugins {#installing-plugins}
An MDX plugin is usually a npm package, so you install them like other npm packages using npm. Take the [math plugins](./markdown-features-math-equations.mdx) as example.
```bash npm2yarn
npm install --save remark-math@3 rehype-katex@4
```
:::note
There's recently a trend in the Remark/Rehype ecosystem to migrate to ES Modules, which Docusaurus doesn't support yet. Please make sure your installed plugin version is CommonJS-compatible before we officially support ESM.
:::
<details>
<summary>How are <code>remark-math</code> and <code>rehype-katex</code> different?</summary>
In case you are wondering how Remark and Rehype are different, here is a good example. `remark-math` operates on the Markdown AST, where it sees text like `$...$`, and all it does is transforms that to the JSX `<span class="math math-inline">...</span>` without doing too much with the content. This decouples the extraction of math formulae from their rendering, which means you can swap $\KaTeX$ out with other math renderers, like MathJax (with [`rehype-mathjax`](https://github.com/remarkjs/remark-math/tree/main/packages/rehype-mathjax)), just by replacing the Rehype plugin.
Next, the `rehype-katex` operates on the Hypertext AST where everything has been converted to HTML-like tags already. It traverses all the elements with `math` class, and uses $\KaTeX$ to parse and render the content to actual HTML.
</details>
Next, add them to the plugin options through plugin or preset config in `docusaurus.config.js`:
```js title="docusaurus.config.js"
// highlight-start
const math = require('remark-math');
const katex = require('rehype-katex');
// highlight-end
module.exports = {
title: 'Docusaurus',
tagline: 'Build optimized websites quickly, focus on your content',
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
// highlight-start
remarkPlugins: [math],
rehypePlugins: [katex],
// highlight-end
},
},
],
],
};
```
## Configuring plugins {#configuring-plugins}
Some plugins can be configured and accept their own options. In that case, use the `[plugin, pluginOptions]` syntax, like this:
```jsx title="docusaurus.config.js"
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
remarkPlugins: [math],
rehypePlugins: [
// highlight-next-line
[katex, {strict: false}],
],
},
},
],
],
};
```
You should check your plugin's documentation for options it supports.
## Creating new rehype/remark plugins
If there isn't an existing package that satisfies your customization need, you can create your own MDX plugin.
:::note
The writeup below is **not** meant to be a comprehensive guide to creating a plugin, but just an illustration of how to make it work with Docusaurus. Visit the [Remark](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#creating-plugins) or [Rehype](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#creating-plugins) documentation for a more in-depth explanation of how they work.
:::
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate NPM package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` which operates on the AST.
```js "src/remark/section-prefix.js"
const visit = require('unist-util-visit');
const plugin = (options) => {
const transformer = async (ast) => {
let number = 1;
visit(ast, 'heading', (node) => {
if (node.depth === 2 && node.children.length > 0) {
if (node.children[0].type === 'text') {
node.children[0].value = `Section ${number}. ${node.children[0].value}`;
} else {
node.children.unshift({
type: 'text',
value: `Section ${number}. `,
});
}
number++;
}
});
};
return transformer;
};
module.exports = plugin;
```
You can now import your plugin in `docusaurus.config.js` and use it just like an installed plugin!
```jsx title="docusaurus.config.js"
// highlight-next-line
const sectionPrefix = require('./src/remark/section-prefix');
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
// highlight-next-line
remarkPlugins: [sectionPrefix],
},
},
],
],
};
```
:::note
The default plugins of Docusaurus would operate before the custom remark plugins, and that means the images or links have been converted to JSX with `require()` calls already. For example, in the example above, the table of contents generated is still the same even when all `h2` headings are now prefixed by `Section X.`, because the TOC-generating plugin is called before our custom plugin. If you need to process the MDAST before the default plugins do, use the `beforeDefaultRemarkPlugins` and `beforeDefaultRehypePlugins`.
```jsx title="docusaurus.config.js"
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
// highlight-next-line
beforeDefaultRemarkPlugins: [sectionPrefix],
},
},
],
],
};
```
This would make the table of contents generated contain the `Section X.` prefix as well.
:::

View file

@ -2,6 +2,7 @@
id: crowdin
title: i18n - Using Crowdin
slug: /i18n/crowdin
toc_max_heading_level: 4
---
The i18n system of Docusaurus is **decoupled from any translation software**.

View file

@ -15,7 +15,7 @@ Use **[docusaurus.new](https://docusaurus.new)** to test Docusaurus immediately
## Requirements {#requirements}
- [Node.js](https://nodejs.org/en/download/) version >= 12.13.0 or above (which can be checked by running `node -v`). You can use [nvm](https://github.com/nvm-sh/nvm) for managing multiple Node versions on a single machine installed
- [Node.js](https://nodejs.org/en/download/) version >= 14 or above (which can be checked by running `node -v`). You can use [nvm](https://github.com/nvm-sh/nvm) for managing multiple Node versions on a single machine installed
- [Yarn](https://yarnpkg.com/en/) version >= 1.5 (which can be checked by running `yarn --version`). Yarn is a performant package manager for JavaScript and replaces the `npm` client. It is not strictly necessary but highly encouraged.
## Scaffold project website {#scaffold-project-website}

View file

@ -1,6 +1,7 @@
---
id: lifecycle-apis
title: Lifecycle APIs
toc_max_heading_level: 4
---
:::caution
@ -162,9 +163,9 @@ Plugins should use the data loaded in `loadContent` and construct the pages/rout
### `actions` {#actions}
`actions` contain two functions:
`actions` contain three functions:
- `addRoute(config: RouteConfig): void`
#### `addRoute(config: RouteConfig): void`
Create a route to add to the website.
@ -189,7 +190,7 @@ type Module =
| string;
```
- `createData(name: string, data: any): Promise<string>`
#### `createData(name: string, data: any): Promise<string>`
A function to help you create static data (generally json or string), that you can provide to your routes as props.
@ -231,7 +232,7 @@ export default function friendsPlugin(context, options) {
}
```
- `setGlobalData(data: any): void`
#### `setGlobalData(data: any): void`
This function permits to create some global plugin data, that can be read from any page, including the pages created by other plugins, and your theme layout.

View file

@ -2,6 +2,7 @@
id: migration-manual
title: Manual migration
slug: /migration/manual
toc_max_heading_level: 4
---
This manual migration process should be run after the [automated migration process](./migration-automated.md), to complete the missing parts, or debug issues in the migration CLI output.

View file

@ -25,7 +25,7 @@ There are a few options you can use to add search to your website:
Docusaurus has **official support** for [Algolia DocSearch](https://docsearch.algolia.com).
The service is **free** in most cases: just [apply to the DocSearch program](https://docsearch.algolia.com/docs/apply).
The service is **free** in most cases: just [apply to the DocSearch program](https://docsearch.algolia.com/apply).
It works by crawling the content of your website every 24 hours and putting all the content in an Algolia index. This content is then queried directly from your front-end using the Algolia API.
@ -86,6 +86,9 @@ module.exports = {
// Optional: see doc section below
contextualSearch: true,
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
externalUrlRegex: 'external\\.com|domain\\.com',
// Optional: see doc section below
appId: 'YOUR_APP_ID',

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