chore: prepare v2.0.0-beta.19 release (#7325)

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

* v2.0.0-beta.19
This commit is contained in:
Alexey Pyltsyn 2022-05-04 18:38:45 +03:00 committed by GitHub
parent 7944fdd9a2
commit 6fa51890f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
134 changed files with 1971 additions and 923 deletions

View file

@ -1,5 +1,293 @@
# Docusaurus 2 Changelog
## 2.0.0-beta.19 (2022-05-04)
#### :rocket: New Feature
- `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#7178](https://github.com/facebook/docusaurus/pull/7178) feat(theme-classic): extensible code block magic comment system ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7007](https://github.com/facebook/docusaurus/pull/7007) feat(theme-classic): code block showLineNumbers ([@lex111](https://github.com/lex111))
- [#7012](https://github.com/facebook/docusaurus/pull/7012) feat(theme-classic): show blog sidebar on mobile ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`, `docusaurus-theme-live-codeblock`, `docusaurus`, `eslint-plugin`
- [#7206](https://github.com/facebook/docusaurus/pull/7206) feat: Docusaurus ESLint plugin to enforce best Docusaurus practices ([@elias-pap](https://github.com/elias-pap))
- `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-theme-classic`, `docusaurus-types`, `docusaurus`
- [#6732](https://github.com/facebook/docusaurus/pull/6732) feat(core): rework client modules lifecycles, officially make API public ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`
- [#7231](https://github.com/facebook/docusaurus/pull/7231) feat: allow custom navbarItem types to pass through validation ([@slorber](https://github.com/slorber))
- [#7058](https://github.com/facebook/docusaurus/pull/7058) feat(theme-classic): new 'html' type navbar item ([@lex111](https://github.com/lex111))
- [#7079](https://github.com/facebook/docusaurus/pull/7079) feat: allow using pure HTML as label in navbar links ([@lex111](https://github.com/lex111))
- `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-translations`
- [#7036](https://github.com/facebook/docusaurus/pull/7036) feat(theme-classic): toggle code wrap button ([@lex111](https://github.com/lex111))
- `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#6457](https://github.com/facebook/docusaurus/pull/6457) feat(content-docs): draft docs excluded from build & sidebars ([@jodyheavener](https://github.com/jodyheavener))
- `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-types`, `docusaurus`
- [#6430](https://github.com/facebook/docusaurus/pull/6430) feat: allow setting calendar for i18n date formatting ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-module-type-aliases`, `docusaurus-plugin-content-docs`, `docusaurus-types`, `docusaurus`
- [#7083](https://github.com/facebook/docusaurus/pull/7083) feat(core): fail-safe global data fetching ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-content-docs`
- [#7106](https://github.com/facebook/docusaurus/pull/7106) feat(content-docs): make docs:version command work on localized docs ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-types`, `docusaurus`
- [#7082](https://github.com/facebook/docusaurus/pull/7082) feat(core): allow plugins to declare custom route context ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7124](https://github.com/facebook/docusaurus/pull/7124) feat(core): allow plugin/preset config to contain false/null ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-sitemap`, `docusaurus-utils`
- [#6979](https://github.com/facebook/docusaurus/pull/6979) feat(sitemap): add ignorePatterns option ([@ApsarasX](https://github.com/ApsarasX))
#### :boom: Breaking Change
- `docusaurus-types`, `docusaurus`
- [#7257](https://github.com/facebook/docusaurus/pull/7257) refactor: remove long-deprecated routesLoaded lifecycle ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#7277](https://github.com/facebook/docusaurus/pull/7277) refactor(theme-classic): move all sidebar-related config under themeConfig.docs.sidebar ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-theme-classic`, `docusaurus-types`, `docusaurus`
- [#6732](https://github.com/facebook/docusaurus/pull/6732) feat(core): rework client modules lifecycles, officially make API public ([@Josh-Cena](https://github.com/Josh-Cena))
- `create-docusaurus`, `docusaurus-theme-classic`
- [#7176](https://github.com/facebook/docusaurus/pull/7176) refactor: customize code block line highlight color via CSS var ([@lex111](https://github.com/lex111))
- `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-types`, `docusaurus-utils-validation`, `docusaurus-utils`
- [#7117](https://github.com/facebook/docusaurus/pull/7117) refactor(content-{blog,docs}): unify handling of tags ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-theme-classic`, `docusaurus-theme-live-codeblock`
- [#7027](https://github.com/facebook/docusaurus/pull/7027) refactor(content-docs): deduplicate types, JSDoc for some APIs ([@Josh-Cena](https://github.com/Josh-Cena))
#### :bug: Bug Fix
- `docusaurus-theme-classic`
- [#7304](https://github.com/facebook/docusaurus/pull/7304) fix(theme-classic): remove breadcrumb items without href from microdata ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7179](https://github.com/facebook/docusaurus/pull/7179) fix(theme-classic): do not add microdata item prop to trailing breadcrumb ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7173](https://github.com/facebook/docusaurus/pull/7173) fix(theme-classic): admonition title: disable text-transform on inline code blocks ([@chelproc](https://github.com/chelproc))
- [#7048](https://github.com/facebook/docusaurus/pull/7048) fix(theme-classic): add caret for dropdown on mobile ([@lex111](https://github.com/lex111))
- [#7025](https://github.com/facebook/docusaurus/pull/7025) fix: make docs page wrapper take full height ([@lex111](https://github.com/lex111))
- [#7013](https://github.com/facebook/docusaurus/pull/7013) fix(theme-classic): adjust shadow on code block ([@chernodub](https://github.com/chernodub))
- [#7015](https://github.com/facebook/docusaurus/pull/7015) fix(theme-classic): do not add caret for non-collapsible categories ([@Josh-Cena](https://github.com/Josh-Cena))
- `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-sitemap`, `docusaurus-preset-classic`, `docusaurus-theme-classic`
- [#7294](https://github.com/facebook/docusaurus/pull/7294) fix(\*): make TypeScript realize that each plugin package has a default export ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus`
- [#7285](https://github.com/facebook/docusaurus/pull/7285) fix(core): allow empty static directories ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7180](https://github.com/facebook/docusaurus/pull/7180) fix: pass pollOptions to webpack ([@JohnnyMcWeed](https://github.com/JohnnyMcWeed))
- [#7184](https://github.com/facebook/docusaurus/pull/7184) fix(core): prevent 404 when accessing /page.html ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7225](https://github.com/facebook/docusaurus/pull/7225) fix: allow swizzling a component's parent folder ([@slorber](https://github.com/slorber))
- [#7066](https://github.com/facebook/docusaurus/pull/7066) fix(core): all plugin lifecycles should receive translated content ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-content-docs`
- [#7233](https://github.com/facebook/docusaurus/pull/7233) fix(content-docs): make category index text translatable ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-common`
- [#7200](https://github.com/facebook/docusaurus/pull/7200) fix(theme-common): do not persist color mode for OS-triggered changes ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7057](https://github.com/facebook/docusaurus/pull/7057) fix(theme-common): use native scrolling when smooth behavior set in CSS ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7033](https://github.com/facebook/docusaurus/pull/7033) fix(theme): only parse HTML- and JSX-style comments in MD code ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-content-blog`
- [#7212](https://github.com/facebook/docusaurus/pull/7212) fix(content-blog): make footnote reference DOM ID unique on post listing page ([@AkiraVoid](https://github.com/AkiraVoid))
- `docusaurus-utils`, `docusaurus`
- [#7187](https://github.com/facebook/docusaurus/pull/7187) fix(core): handle case where package.json is not available at CWD ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-translations`
- [#7222](https://github.com/facebook/docusaurus/pull/7222) fix(theme-translations): fix invalid pluralization in cs ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7166](https://github.com/facebook/docusaurus/pull/7166) fix(theme-translations): always try all possible locale resolutions ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`, `docusaurus-theme-search-algolia`
- [#7164](https://github.com/facebook/docusaurus/pull/7164) fix: adjust spacing for custom search properly ([@lex111](https://github.com/lex111))
- `docusaurus-plugin-debug`, `docusaurus-plugin-sitemap`, `docusaurus-preset-classic`, `docusaurus-types`, `docusaurus`
- [#7143](https://github.com/facebook/docusaurus/pull/7143) fix(sitemap): exclude pages with robots noindex from sitemap ([@Josh-Cena](https://github.com/Josh-Cena))
- `create-docusaurus`, `docusaurus-types`
- [#7078](https://github.com/facebook/docusaurus/pull/7078) fix(create): install types for JS template as well ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-utils`
- [#7043](https://github.com/facebook/docusaurus/pull/7043) fix(utils): parse Markdown headings with CRLF line break ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-utils`, `docusaurus`
- [#7023](https://github.com/facebook/docusaurus/pull/7023) refactor: fix a few places of path handling ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-types`
- [#7014](https://github.com/facebook/docusaurus/pull/7014) fix(types): declare history and react-loadable as dependencies ([@sulu5890](https://github.com/sulu5890))
#### :nail_care: Polish
- `docusaurus-theme-classic`, `docusaurus-theme-translations`
- [#7299](https://github.com/facebook/docusaurus/pull/7299) refactor: minor improvements for breadcrumbs ([@lex111](https://github.com/lex111))
- `create-docusaurus`
- [#7290](https://github.com/facebook/docusaurus/pull/7290) refactor(create): add i18n config in init template ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7286](https://github.com/facebook/docusaurus/pull/7286) refactor(create): update screenshots in quick start tutorial ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7223](https://github.com/facebook/docusaurus/pull/7223) refactor: use generated-index in init templates ([@slorber](https://github.com/slorber))
- [#7118](https://github.com/facebook/docusaurus/pull/7118) refactor(create): mention that the edit links can be removed ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-debug`, `docusaurus-theme-classic`
- [#7306](https://github.com/facebook/docusaurus/pull/7306) chore: upgrade Infima to alpha.39 ([@lex111](https://github.com/lex111))
- `docusaurus-plugin-debug`, `docusaurus-types`, `docusaurus`
- [#7291](https://github.com/facebook/docusaurus/pull/7291) feat(types): JSDoc for docusaurus config fields ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#7267](https://github.com/facebook/docusaurus/pull/7267) fix(theme-common): allow details to not provide a summary ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7172](https://github.com/facebook/docusaurus/pull/7172) refactor: control base styling of code blocks via CSS vars ([@lex111](https://github.com/lex111))
- [#7129](https://github.com/facebook/docusaurus/pull/7129) refactor(theme-classic): fix a few margin inconsistencies ([@lex111](https://github.com/lex111))
- `docusaurus-plugin-content-docs`, `docusaurus-utils`
- [#7248](https://github.com/facebook/docusaurus/pull/7248) refactor: normalize Markdown linkification behavior, elaborate in documentation ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`
- [#7244](https://github.com/facebook/docusaurus/pull/7244) refactor: semantic markup improvement, fix validation warnings ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7183](https://github.com/facebook/docusaurus/pull/7183) refactor: use SVG icon for home breadcrumb ([@Dr-Electron](https://github.com/Dr-Electron))
- [#7139](https://github.com/facebook/docusaurus/pull/7139) fix: proper spacing between generated card items on mobiles ([@lex111](https://github.com/lex111))
- [#7134](https://github.com/facebook/docusaurus/pull/7134) fix(theme-classic): fix docs sidebar layout shifts when expanding categories ([@slorber](https://github.com/slorber))
- [#7068](https://github.com/facebook/docusaurus/pull/7068) refactor(theme-classic): blog mobile secondary menu use consistent styles ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7004](https://github.com/facebook/docusaurus/pull/7004) fix(theme-classic): shrink title size on mobile ([@Pierre-Gilles](https://github.com/Pierre-Gilles))
- `docusaurus-theme-translations`
- [#7214](https://github.com/facebook/docusaurus/pull/7214) chore(theme-translations): complete Polish translations ([@rev4324](https://github.com/rev4324))
- [#7031](https://github.com/facebook/docusaurus/pull/7031) chore(theme-translations): complete German translations ([@deployn](https://github.com/deployn))
- `create-docusaurus`, `docusaurus-theme-classic`
- [#7176](https://github.com/facebook/docusaurus/pull/7176) refactor: customize code block line highlight color via CSS var ([@lex111](https://github.com/lex111))
- `docusaurus`
- [#7218](https://github.com/facebook/docusaurus/pull/7218) fix(cli): always show error stack to unhandled rejection ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7142](https://github.com/facebook/docusaurus/pull/7142) refactor(core): lower timeout before rendering progress bar to 200ms ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7103](https://github.com/facebook/docusaurus/pull/7103) fix(core): preserve Interpolate children semantics ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7029](https://github.com/facebook/docusaurus/pull/7029) refactor: console output improvements ([@lex111](https://github.com/lex111))
- [#7017](https://github.com/facebook/docusaurus/pull/7017) refactor: remove copyright comment from swizzled components ([@lex111](https://github.com/lex111))
- `docusaurus-plugin-content-docs`, `docusaurus-preset-classic`, `docusaurus-theme-classic`
- [#7148](https://github.com/facebook/docusaurus/pull/7148) feat(preset-classic, content-docs/client): JSDoc ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-debug`, `docusaurus-preset-classic`
- [#7122](https://github.com/facebook/docusaurus/pull/7122) feat(preset-classic): exclude debug plugin routes from sitemap ([@lex111](https://github.com/lex111))
- `docusaurus-theme-common`, `docusaurus-utils`, `docusaurus`
- [#7113](https://github.com/facebook/docusaurus/pull/7113) test: improve test coverage ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-mdx-loader`, `docusaurus-migrate`, `docusaurus-module-type-aliases`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-ideal-image`, `docusaurus-remark-plugin-npm2yarn`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-types`, `docusaurus-utils-validation`, `docusaurus`
- [#7080](https://github.com/facebook/docusaurus/pull/7080) refactor: replace non-prop interface with type; allow plugin lifecycles to have sync type ([@Josh-Cena](https://github.com/Josh-Cena))
- `create-docusaurus`, `docusaurus-logger`, `docusaurus-plugin-content-docs`, `docusaurus`
- [#7019](https://github.com/facebook/docusaurus/pull/7019) feat(logger): new "url" format, add double quotes around paths ([@lex111](https://github.com/lex111))
- `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#7006](https://github.com/facebook/docusaurus/pull/7006) refactor: split and cleanup theme/DocPage ([@slorber](https://github.com/slorber))
- `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`
- [#7005](https://github.com/facebook/docusaurus/pull/7005) refactor: split DocSidebarItem by item type ([@slorber](https://github.com/slorber))
#### :memo: Documentation
- `docusaurus-logger`
- [#7305](https://github.com/facebook/docusaurus/pull/7305) docs: update docs for logger, add API docs to website ([@Josh-Cena](https://github.com/Josh-Cena))
- Other
- [#7284](https://github.com/facebook/docusaurus/pull/7284) docs: add a paragraph about SSR as an optimization technique ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7278](https://github.com/facebook/docusaurus/pull/7278) docs: enhance docs about Markdown TOC and metadata ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7271](https://github.com/facebook/docusaurus/pull/7271) docs: specify Node version requirement to a minor ([@DanRoscigno](https://github.com/DanRoscigno))
- [#7252](https://github.com/facebook/docusaurus/pull/7252) docs: update gtag docs to reflect what a GA4 tag looks like ([@johnnyreilly](https://github.com/johnnyreilly))
- [#7240](https://github.com/facebook/docusaurus/pull/7240) docs: add PCC Archive site to showcase ([@CuratorCat](https://github.com/CuratorCat))
- [#7239](https://github.com/facebook/docusaurus/pull/7239) docs: add Chaos mesh site to showcase ([@cwen0](https://github.com/cwen0))
- [#7235](https://github.com/facebook/docusaurus/pull/7235) docs: add TiDB community books to showcase ([@shczhen](https://github.com/shczhen))
- [#7236](https://github.com/facebook/docusaurus/pull/7236) docs: add documentation about pluralization ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7230](https://github.com/facebook/docusaurus/pull/7230) docs: add OSS Insight to showcase ([@sykp241095](https://github.com/sykp241095))
- [#7208](https://github.com/facebook/docusaurus/pull/7208) docs: remove mention of "template" from README installation guide ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7159](https://github.com/facebook/docusaurus/pull/7159) docs: explain more clearly the purpose of a ref sidebar type ([@andrewnicols](https://github.com/andrewnicols))
- [#7126](https://github.com/facebook/docusaurus/pull/7126) docs: multiple documentation improvements ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7123](https://github.com/facebook/docusaurus/pull/7123) refactor(showcase): enforce descriptions with maximum length of 120 characters ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7026](https://github.com/facebook/docusaurus/pull/7026) docs: correct plugin example filename ([@mxhdx](https://github.com/mxhdx))
- [#7110](https://github.com/facebook/docusaurus/pull/7110) docs: add a note about additional languages needing to be Prism component names ([@Josh-Cena](https://github.com/Josh-Cena))
- [#6746](https://github.com/facebook/docusaurus/pull/6746) fix(website): lazy-load YT iframe ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7061](https://github.com/facebook/docusaurus/pull/7061) docs: add docusaurus-plugin-typedoc to resources ([@nartc](https://github.com/nartc))
- [#7059](https://github.com/facebook/docusaurus/pull/7059) docs: add firelordjs to showcase ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7050](https://github.com/facebook/docusaurus/pull/7050) docs: add import React statement in JSX file example ([@kaycebasques](https://github.com/kaycebasques))
- [#7022](https://github.com/facebook/docusaurus/pull/7022) docs: add Easypanel to showcase ([@deiucanta](https://github.com/deiucanta))
- [#7016](https://github.com/facebook/docusaurus/pull/7016) docs: consistently use sidebars.js filename ([@leedom92](https://github.com/leedom92))
- [#7020](https://github.com/facebook/docusaurus/pull/7020) docs: add Divine WSF and Ghostly to showcase ([@LeviticusMB](https://github.com/LeviticusMB))
- [#7000](https://github.com/facebook/docusaurus/pull/7000) docs: remove unnecessary semicolon ([@imsingh](https://github.com/imsingh))
- `docusaurus-plugin-content-docs`, `docusaurus-utils`
- [#7248](https://github.com/facebook/docusaurus/pull/7248) refactor: normalize Markdown linkification behavior, elaborate in documentation ([@Josh-Cena](https://github.com/Josh-Cena))
- `create-docusaurus`, `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-utils`
- [#7081](https://github.com/facebook/docusaurus/pull/7081) docs: fix some casing inconsistencies ([@Josh-Cena](https://github.com/Josh-Cena))
#### :wrench: Maintenance
- Other
- [#7309](https://github.com/facebook/docusaurus/pull/7309) chore: use "Maintenance" instead of "Internal" in changelog ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7300](https://github.com/facebook/docusaurus/pull/7300) misc: check doc page by Lighthouse CI ([@lex111](https://github.com/lex111))
- [#7266](https://github.com/facebook/docusaurus/pull/7266) misc: add links section to PR template ([@slorber](https://github.com/slorber))
- [#7224](https://github.com/facebook/docusaurus/pull/7224) chore: GitHub Actions cancel-in-progress ([@slorber](https://github.com/slorber))
- [#7216](https://github.com/facebook/docusaurus/pull/7216) chore: remove netlify-cli from devDependencies ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7211](https://github.com/facebook/docusaurus/pull/7211) chore: replace node 17 with 18 in CI matrix ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7168](https://github.com/facebook/docusaurus/pull/7168) misc: add CI actions/dependency-review-action for security ([@slorber](https://github.com/slorber))
- [#6984](https://github.com/facebook/docusaurus/pull/6984) misc: pin actions to a full-length commit SHA ([@naveensrinivasan](https://github.com/naveensrinivasan))
- [#7002](https://github.com/facebook/docusaurus/pull/7002) chore: regen examples for 2.0 beta.18 ([@slorber](https://github.com/slorber))
- `docusaurus-logger`, `docusaurus-remark-plugin-npm2yarn`
- [#7295](https://github.com/facebook/docusaurus/pull/7295) refactor: use export = syntax for Node utility packages ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-types`, `docusaurus-utils-validation`, `docusaurus-utils`, `docusaurus`
- [#7293](https://github.com/facebook/docusaurus/pull/7293) refactor(types): move non-core, non-public types out of the types package ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-types`, `docusaurus`
- [#7292](https://github.com/facebook/docusaurus/pull/7292) refactor(core): collocate CLI commands and their option types ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7084](https://github.com/facebook/docusaurus/pull/7084) refactor(core): code cleanup ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-module-type-aliases`, `docusaurus`
- [#7282](https://github.com/facebook/docusaurus/pull/7282) refactor(core): prefetch/preload refactor ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#7273](https://github.com/facebook/docusaurus/pull/7273) refactor(theme-classic): multiple re-arrangements ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7268](https://github.com/facebook/docusaurus/pull/7268) refactor(theme-classic): DocPage theme refactors polish ([@slorber](https://github.com/slorber))
- [#7269](https://github.com/facebook/docusaurus/pull/7269) refactor: extract useSkipToContent() ([@slorber](https://github.com/slorber))
- [#7175](https://github.com/facebook/docusaurus/pull/7175) refactor(theme-classic): split CodeBlock ([@slorber](https://github.com/slorber))
- [#7067](https://github.com/facebook/docusaurus/pull/7067) refactor(theme-classic): extract doc-related navbar items' logic to theme-common ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7021](https://github.com/facebook/docusaurus/pull/7021) refactor(theme): extract plumbing code of BTT button into theme-common ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`
- [#7270](https://github.com/facebook/docusaurus/pull/7270) refactor(theme-classic): refactor TOC-related theme components ([@slorber](https://github.com/slorber))
- `docusaurus`
- [#7220](https://github.com/facebook/docusaurus/pull/7220) refactor(cli): normalize the application of default option values ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7141](https://github.com/facebook/docusaurus/pull/7141) refactor(core): minor PendingNavigation refactor ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-content-docs`
- [#7243](https://github.com/facebook/docusaurus/pull/7243) chore: upgrade Jest to 28; add GitHub-actions reporter ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7140](https://github.com/facebook/docusaurus/pull/7140) refactor(content-docs): split version handling into several files ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-pwa`, `docusaurus-theme-live-codeblock`, `docusaurus`
- [#7194](https://github.com/facebook/docusaurus/pull/7194) fix: fix a few internal declaration semantic errors ([@Josh-Cena](https://github.com/Josh-Cena))
- `create-docusaurus`, `docusaurus-migrate`, `docusaurus-theme-translations`, `docusaurus`
- [#7186](https://github.com/facebook/docusaurus/pull/7186) refactor: prefer fs.readJSON over readFile.then(JSON.parse) ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`
- [#7145](https://github.com/facebook/docusaurus/pull/7145) refactor: unify how MDX content types are represented ([@Josh-Cena](https://github.com/Josh-Cena))
- `create-docusaurus`, `docusaurus-mdx-loader`, `docusaurus-migrate`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-pwa`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-search-algolia`, `docusaurus-types`, `docusaurus-utils`, `docusaurus`, `lqip-loader`
- [#7138](https://github.com/facebook/docusaurus/pull/7138) chore: upgrade dependencies + upgrade React types ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-logger`, `docusaurus-mdx-loader`, `docusaurus-migrate`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-sitemap`, `docusaurus-remark-plugin-npm2yarn`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-theme-search-algolia`, `docusaurus-theme-translations`, `docusaurus-utils-validation`, `docusaurus-utils`, `docusaurus`
- [#7131](https://github.com/facebook/docusaurus/pull/7131) chore: disable string escaping in snapshots ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-module-type-aliases`, `docusaurus-plugin-content-blog`, `docusaurus-theme-common`, `docusaurus-types`, `docusaurus-utils`, `docusaurus`
- [#7054](https://github.com/facebook/docusaurus/pull/7054) refactor(core): refactor routes generation logic ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-module-type-aliases`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-types`, `docusaurus`
- [#7042](https://github.com/facebook/docusaurus/pull/7042) refactor(core): reorganize files ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-plugin-content-docs`, `docusaurus-utils`, `docusaurus`
- [#7037](https://github.com/facebook/docusaurus/pull/7037) refactor(core): reorganize functions ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-theme-classic`, `docusaurus-theme-live-codeblock`
- [#7027](https://github.com/facebook/docusaurus/pull/7027) refactor(content-docs): deduplicate types, JSDoc for some APIs ([@Josh-Cena](https://github.com/Josh-Cena))
#### :running_woman: Performance
- `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-theme-search-algolia`, `docusaurus-utils-common`
- [#7085](https://github.com/facebook/docusaurus/pull/7085) refactor: mark a few client-side packages as side-effect-free ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-mdx-loader`, `docusaurus-remark-plugin-npm2yarn`
- [#4997](https://github.com/facebook/docusaurus/pull/4997) perf(mdx-loader): cache mdx/remark compiler instances ([@phryneas](https://github.com/phryneas))
#### Committers: 47
- Aaron Nwabuoku ([@aerovulpe](https://github.com/aerovulpe))
- AkiraVoid ([@AkiraVoid](https://github.com/AkiraVoid))
- Alexey Pyltsyn ([@lex111](https://github.com/lex111))
- Andrei Canta ([@deiucanta](https://github.com/deiucanta))
- Andrew Lyons ([@andrewnicols](https://github.com/andrewnicols))
- ApsarasX ([@ApsarasX](https://github.com/ApsarasX))
- Chau Tran ([@nartc](https://github.com/nartc))
- Chinazaekpere Ngubo ([@dr-ngubo](https://github.com/dr-ngubo))
- Cwen Yin ([@cwen0](https://github.com/cwen0))
- Dan Roscigno ([@DanRoscigno](https://github.com/DanRoscigno))
- Elias Papavasileiou ([@elias-pap](https://github.com/elias-pap))
- Evan ([@sulu5890](https://github.com/sulu5890))
- Fusang❀ ([@cxOrz](https://github.com/cxOrz))
- Indermohan Singh ([@imsingh](https://github.com/imsingh))
- JMW ([@JohnnyMcWeed](https://github.com/JohnnyMcWeed))
- Jeffrey Aven ([@jeffreyaven](https://github.com/jeffreyaven))
- Jody Heavener ([@jodyheavener](https://github.com/jodyheavener))
- John Reilly ([@johnnyreilly](https://github.com/johnnyreilly))
- Joshua Chen ([@Josh-Cena](https://github.com/Josh-Cena))
- Karl Ward ([@mjau-mjau](https://github.com/mjau-mjau))
- Kayce Basques ([@kaycebasques](https://github.com/kaycebasques))
- Leedom ([@leedom92](https://github.com/leedom92))
- Lenz Weber-Tronic ([@phryneas](https://github.com/phryneas))
- Lukas Bach ([@lukasbach](https://github.com/lukasbach))
- Martin Blom ([@LeviticusMB](https://github.com/LeviticusMB))
- Naveen ([@naveensrinivasan](https://github.com/naveensrinivasan))
- Pablo Cordon ([@pcordon](https://github.com/pcordon))
- Pierre-Gilles Leymarie ([@Pierre-Gilles](https://github.com/Pierre-Gilles))
- Qi Zhang ([@zzzhangqi](https://github.com/zzzhangqi))
- Sébastien Lorber ([@slorber](https://github.com/slorber))
- Viktor Chernodub ([@chernodub](https://github.com/chernodub))
- Zac A ([@sandypockets](https://github.com/sandypockets))
- [@Dr-Electron](https://github.com/Dr-Electron)
- [@chelproc](https://github.com/chelproc)
- [@deployn](https://github.com/deployn)
- [@duanwilliam](https://github.com/duanwilliam)
- [@kgolubic](https://github.com/kgolubic)
- [@redhat123456](https://github.com/redhat123456)
- [@surendran82](https://github.com/surendran82)
- [@svix-ken](https://github.com/svix-ken)
- apq ([@AntonPalmqvist](https://github.com/AntonPalmqvist))
- curatorcat.pcc.eth ([@CuratorCat](https://github.com/CuratorCat))
- czhen ([@shczhen](https://github.com/shczhen))
- loic ([@layerzzzio](https://github.com/layerzzzio))
- mehdim ([@mxhdx](https://github.com/mxhdx))
- rev ([@rev4324](https://github.com/rev4324))
- sykp241095 ([@sykp241095](https://github.com/sykp241095))
## 2.0.0-beta.18 (2022-03-25)
#### :rocket: New Feature

View file

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

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "create-docusaurus",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Create Docusaurus apps easily.",
"type": "module",
"repository": {
@ -22,7 +22,7 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.19",
"commander": "^5.1.0",
"fs-extra": "^10.1.0",
"lodash": "^4.17.21",

View file

@ -1,6 +1,6 @@
{
"name": "docusaurus-2-classic-typescript-template",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@ -15,8 +15,8 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/preset-classic": "2.0.0-beta.19",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.3.1",
@ -24,7 +24,7 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@docusaurus/module-type-aliases": "2.0.0-beta.19",
"@tsconfig/docusaurus": "^1.0.5",
"typescript": "^4.6.4"
},

View file

@ -1,6 +1,6 @@
{
"name": "docusaurus-2-classic-template",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@ -14,8 +14,8 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/preset-classic": "2.0.0-beta.19",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.3.1",
@ -23,7 +23,7 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18"
"@docusaurus/module-type-aliases": "2.0.0-beta.19"
},
"browserslist": {
"production": [

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/mdx-loader",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Docusaurus Loader for MDX",
"main": "lib/index.js",
"types": "lib/index.d.ts",
@ -20,8 +20,8 @@
"dependencies": {
"@babel/parser": "^7.17.10",
"@babel/traverse": "^7.17.10",
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@mdx-js/mdx": "^1.6.22",
"escape-html": "^1.0.3",
"file-loader": "^6.2.0",
@ -36,7 +36,7 @@
"webpack": "^5.72.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.19",
"@types/escape-html": "^1.0.2",
"@types/mdast": "^3.0.10",
"@types/stringify-object": "^3.3.1",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/migrate",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "A CLI tool to migrate from older versions of Docusaurus.",
"license": "MIT",
"engines": {
@ -23,8 +23,8 @@
},
"dependencies": {
"@babel/preset-env": "^7.17.10",
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@mapbox/hast-util-to-jsx": "^2.0.0",
"color": "^4.2.3",
"commander": "^5.1.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/module-type-aliases",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Docusaurus module type aliases.",
"types": "./src/index.d.ts",
"publishConfig": {
@ -12,7 +12,7 @@
"directory": "packages/docusaurus-module-type-aliases"
},
"dependencies": {
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.19",
"@types/react": "*",
"@types/react-router-config": "*",
"@types/react-router-dom": "*",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-client-redirects",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Client redirects plugin for Docusaurus.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
@ -18,18 +18,18 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-common": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-common": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"eta": "^1.12.3",
"fs-extra": "^10.1.0",
"lodash": "^4.17.21",
"tslib": "^2.4.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18"
"@docusaurus/types": "2.0.0-beta.19"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-blog",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Blog plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-content-blog.d.ts",
@ -18,12 +18,12 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/mdx-loader": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-common": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/mdx-loader": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-common": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"cheerio": "^1.0.0-rc.10",
"feed": "^4.2.2",
"fs-extra": "^10.1.0",
@ -36,7 +36,7 @@
"webpack": "^5.72.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.19",
"escape-string-regexp": "^4.0.0"
},
"peerDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-docs",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Docs plugin for Docusaurus.",
"main": "lib/index.js",
"sideEffects": false,
@ -25,11 +25,11 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/mdx-loader": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/mdx-loader": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"combine-promises": "^1.1.0",
"fs-extra": "^10.1.0",
"import-fresh": "^3.3.0",
@ -41,8 +41,8 @@
"webpack": "^5.72.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/module-type-aliases": "2.0.0-beta.19",
"@docusaurus/types": "2.0.0-beta.19",
"@types/js-yaml": "^4.0.5",
"@types/picomatch": "^2.3.0",
"commander": "^5.1.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-pages",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Pages plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-content-pages.d.ts",
@ -18,17 +18,17 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/mdx-loader": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/mdx-loader": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"fs-extra": "^10.1.0",
"remark-admonitions": "^1.2.1",
"tslib": "^2.4.0",
"webpack": "^5.72.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18"
"@docusaurus/types": "2.0.0-beta.19"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-debug",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Debug plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-debug.d.ts",
@ -18,14 +18,14 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"fs-extra": "^10.1.0",
"react-json-view": "^1.21.3",
"tslib": "^2.4.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18"
"@docusaurus/types": "2.0.0-beta.19"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

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

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-ideal-image",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"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,11 +21,11 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/lqip-loader": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/lqip-loader": "2.0.0-beta.19",
"@docusaurus/responsive-loader": "^1.7.0",
"@docusaurus/theme-translations": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/theme-translations": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"@endiliey/react-ideal-image": "^0.0.11",
"react-waypoint": "^10.1.0",
"sharp": "^0.30.4",
@ -33,8 +33,8 @@
"webpack": "^5.72.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/module-type-aliases": "2.0.0-beta.19",
"@docusaurus/types": "2.0.0-beta.19",
"fs-extra": "^10.1.0"
},
"peerDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-pwa",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Docusaurus Plugin to add PWA support.",
"main": "lib/index.js",
"types": "src/plugin-pwa.d.ts",
@ -22,11 +22,11 @@
"dependencies": {
"@babel/core": "^7.17.10",
"@babel/preset-env": "^7.17.10",
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/theme-common": "2.0.0-beta.18",
"@docusaurus/theme-translations": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/theme-common": "2.0.0-beta.19",
"@docusaurus/theme-translations": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"babel-loader": "^8.2.5",
"clsx": "^1.1.1",
"core-js": "^3.22.3",
@ -39,7 +39,7 @@
"workbox-window": "^6.5.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@docusaurus/module-type-aliases": "2.0.0-beta.19",
"fs-extra": "^10.1.0"
},
"peerDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-sitemap",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Simple sitemap generation plugin for Docusaurus.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
@ -18,16 +18,16 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-common": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-common": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"fs-extra": "^10.1.0",
"sitemap": "^7.1.1",
"tslib": "^2.4.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18"
"@docusaurus/types": "2.0.0-beta.19"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

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

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-classic",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Classic theme for Docusaurus",
"main": "lib/index.js",
"types": "src/theme-classic.d.ts",
@ -21,15 +21,15 @@
"format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/plugin-content-blog": "2.0.0-beta.18",
"@docusaurus/plugin-content-docs": "2.0.0-beta.18",
"@docusaurus/plugin-content-pages": "2.0.0-beta.18",
"@docusaurus/theme-common": "2.0.0-beta.18",
"@docusaurus/theme-translations": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-common": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/plugin-content-blog": "2.0.0-beta.19",
"@docusaurus/plugin-content-docs": "2.0.0-beta.19",
"@docusaurus/plugin-content-pages": "2.0.0-beta.19",
"@docusaurus/theme-common": "2.0.0-beta.19",
"@docusaurus/theme-translations": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-common": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"copy-text-to-clipboard": "^3.0.1",
@ -46,8 +46,8 @@
"@babel/cli": "^7.17.10",
"@babel/core": "^7.17.10",
"@babel/preset-typescript": "^7.16.7",
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/module-type-aliases": "2.0.0-beta.19",
"@docusaurus/types": "2.0.0-beta.19",
"@types/mdx-js__react": "^1.5.5",
"@types/nprogress": "^0.2.0",
"@types/prismjs": "^1.26.0",

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-common",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Common code for Docusaurus themes.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
@ -26,10 +26,10 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@docusaurus/plugin-content-blog": "2.0.0-beta.18",
"@docusaurus/plugin-content-docs": "2.0.0-beta.18",
"@docusaurus/plugin-content-pages": "2.0.0-beta.18",
"@docusaurus/module-type-aliases": "2.0.0-beta.19",
"@docusaurus/plugin-content-blog": "2.0.0-beta.19",
"@docusaurus/plugin-content-docs": "2.0.0-beta.19",
"@docusaurus/plugin-content-pages": "2.0.0-beta.19",
"clsx": "^1.1.1",
"parse-numeric-range": "^1.3.0",
"prism-react-renderer": "^1.3.1",
@ -37,8 +37,8 @@
"utility-types": "^3.10.0"
},
"devDependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/types": "2.0.0-beta.19",
"fs-extra": "^10.1.0",
"lodash": "^4.17.21"
},

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-live-codeblock",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Docusaurus live code block component.",
"main": "lib/index.js",
"types": "src/theme-live-codeblock.d.ts",
@ -24,10 +24,10 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/theme-common": "2.0.0-beta.18",
"@docusaurus/theme-translations": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/theme-common": "2.0.0-beta.19",
"@docusaurus/theme-translations": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"@philpl/buble": "^0.19.7",
"clsx": "^1.1.1",
"fs-extra": "^10.1.0",
@ -35,7 +35,7 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.19",
"@types/buble": "^0.20.1"
},
"peerDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-search-algolia",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "Algolia search component for Docusaurus.",
"main": "lib/index.js",
"sideEffects": [
@ -29,13 +29,13 @@
},
"dependencies": {
"@docsearch/react": "^3.0.0",
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/plugin-content-docs": "2.0.0-beta.18",
"@docusaurus/theme-common": "2.0.0-beta.18",
"@docusaurus/theme-translations": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/plugin-content-docs": "2.0.0-beta.19",
"@docusaurus/theme-common": "2.0.0-beta.19",
"@docusaurus/theme-translations": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"algoliasearch": "^4.13.0",
"algoliasearch-helper": "^3.8.2",
"clsx": "^1.1.1",
@ -46,7 +46,7 @@
"utility-types": "^3.10.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18"
"@docusaurus/module-type-aliases": "2.0.0-beta.19"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/types",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"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.18",
"version": "2.0.0-beta.19",
"description": "Common (Node/Browser) utility functions for Docusaurus packages.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
@ -22,7 +22,7 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18"
"@docusaurus/types": "2.0.0-beta.19"
},
"engines": {
"node": ">=14"

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/utils-validation",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"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": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"joi": "^17.6.0",
"js-yaml": "^4.1.0",
"tslib": "^2.4.0"

View file

@ -1,6 +1,6 @@
{
"name": "@docusaurus/utils",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"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": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.19",
"@svgr/webpack": "^6.2.1",
"file-loader": "^6.2.0",
"fs-extra": "^10.1.0",
@ -38,7 +38,7 @@
"node": ">=14"
},
"devDependencies": {
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.19",
"@types/dedent": "^0.7.0",
"@types/github-slugger": "^1.3.0",
"@types/micromatch": "^4.0.2",

View file

@ -1,7 +1,7 @@
{
"name": "@docusaurus/core",
"description": "Easy to Maintain Open Source Documentation Websites",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"license": "MIT",
"publishConfig": {
"access": "public"
@ -41,13 +41,13 @@
"@babel/runtime": "^7.17.9",
"@babel/runtime-corejs3": "^7.17.9",
"@babel/traverse": "^7.17.10",
"@docusaurus/cssnano-preset": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/mdx-loader": "2.0.0-beta.18",
"@docusaurus/cssnano-preset": "2.0.0-beta.19",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/mdx-loader": "2.0.0-beta.19",
"@docusaurus/react-loadable": "5.5.2",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-common": "2.0.0-beta.18",
"@docusaurus/utils-validation": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-common": "2.0.0-beta.19",
"@docusaurus/utils-validation": "2.0.0-beta.19",
"@slorber/static-site-generator-webpack-plugin": "^4.0.4",
"@svgr/webpack": "^6.2.1",
"autoprefixer": "^10.4.5",
@ -104,8 +104,8 @@
"webpackbar": "^5.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@docusaurus/types": "2.0.0-beta.18",
"@docusaurus/module-type-aliases": "2.0.0-beta.19",
"@docusaurus/types": "2.0.0-beta.19",
"@types/detect-port": "^1.3.2",
"@types/react-dom": "^18.0.3",
"@types/react-router-config": "^5.0.6",

View file

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

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "stylelint-copyright",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"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.18",
"version": "2.0.0-beta.19",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@ -36,18 +36,18 @@
"dependencies": {
"@crowdin/cli": "^3.7.8",
"@crowdin/crowdin-api-client": "^1.18.0",
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/logger": "2.0.0-beta.18",
"@docusaurus/plugin-client-redirects": "2.0.0-beta.18",
"@docusaurus/plugin-ideal-image": "2.0.0-beta.18",
"@docusaurus/plugin-pwa": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.18",
"@docusaurus/theme-classic": "2.0.0-beta.18",
"@docusaurus/theme-common": "2.0.0-beta.18",
"@docusaurus/theme-live-codeblock": "2.0.0-beta.18",
"@docusaurus/utils": "2.0.0-beta.18",
"@docusaurus/utils-common": "2.0.0-beta.18",
"@docusaurus/core": "2.0.0-beta.19",
"@docusaurus/logger": "2.0.0-beta.19",
"@docusaurus/plugin-client-redirects": "2.0.0-beta.19",
"@docusaurus/plugin-ideal-image": "2.0.0-beta.19",
"@docusaurus/plugin-pwa": "2.0.0-beta.19",
"@docusaurus/preset-classic": "2.0.0-beta.19",
"@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.19",
"@docusaurus/theme-classic": "2.0.0-beta.19",
"@docusaurus/theme-common": "2.0.0-beta.19",
"@docusaurus/theme-live-codeblock": "2.0.0-beta.19",
"@docusaurus/utils": "2.0.0-beta.19",
"@docusaurus/utils-common": "2.0.0-beta.19",
"@popperjs/core": "^2.11.5",
"@swc/core": "^1.2.174",
"clsx": "^1.1.1",
@ -79,8 +79,8 @@
]
},
"devDependencies": {
"@docusaurus/eslint-plugin": "2.0.0-beta.19",
"@tsconfig/docusaurus": "^1.0.5",
"@docusaurus/eslint-plugin": "2.0.0-beta.18",
"@types/jest": "^27.4.1",
"cross-env": "^7.0.3",
"rimraf": "^3.0.2"

View file

@ -1,39 +0,0 @@
---
id: markdown-features
title: Docs Markdown Features
description: Docusaurus Markdown features that are specific to the docs plugin
slug: /docs-markdown-features
---
Docs can use any [Markdown feature](../markdown-features/markdown-features-intro.mdx) and have a few additional docs-specific Markdown features.
## Markdown front matter {#markdown-front-matter}
Markdown docs have their own [Markdown front matter API](../../api/plugins/plugin-content-docs.md#markdown-front-matter).
## Referencing other documents {#referencing-other-documents}
If you want to reference another document file, you could use the relative path of the document you want to link to.
Docusaurus will convert the file path to be the final document url path (and remove the `.md` extension).
For example, if you are in `folder/doc1.md` and you want to reference `folder/doc2.md`, `folder/subfolder/doc3.md` and `otherFolder/doc4.md`:
```md
I am referencing a [document](doc2.md).
Reference to another [document in a subfolder](subfolder/doc3.md).
[Relative document](../otherFolder/doc4.md) referencing works as well.
```
:::tip
Using relative _file_ paths (with `.md` extensions) instead of relative _URL_ links provides the following benefits:
- links will keep working on the GitHub interface
- you can customize the document slugs without having to update all the links
- a versioned doc will link to another doc of the exact same version
- relative links are very likely to break if you update the [`trailingSlash` config](../../api/docusaurus.config.js.md#trailing-slash)
:::

View file

@ -1,67 +0,0 @@
---
id: head-metadata
title: Head Metadata
description: Declaring page-specific head metadata through MDX
slug: /markdown-features/head-metadata
---
# Head Metadata
Docusaurus automatically sets useful page metadata in `<html>`, `<head>` and `<body>` for you.
It is possible to add extra metadata (or override existing ones) by using the `<head>` tag in Markdown files:
```md title="markdown-features-head-metadata.mdx"
---
id: head-metadata
title: Head Metadata
---
<!-- highlight-start -->
<head>
<html className="some-extra-html-class" />
<body className="other-extra-body-class" />
<title>Head Metadata customized title!</title>
<meta charSet="utf-8" />
<meta name="twitter:card" content="summary" />
<link rel="canonical" href="https://docusaurus.io/docs/markdown-features/head-metadata" />
</head>
<!-- highlight-end -->
# Head Metadata
My text
```
```mdx-code-block
<head>
<html className="some-extra-html-class" />
<body className="other-extra-body-class" />
<title>Head Metadata customized title!</title>
<meta charSet="utf-8" />
<meta name="twitter:card" content="summary" />
<link rel="canonical" href="https://docusaurus.io/docs/markdown-features/head-metadata" />
</head>
```
:::tip
This `<head>` declaration has been added to the current Markdown doc, as a demo.
Open your browser DevTools and check how this page's metadata has been affected.
:::
:::tip
**You don't always need this for typical SEO needs.** Content plugins (e.g. docs and blog) provide front matter options like `description`, `keywords`, and `image`, which will be automatically applied to both `description` and `og:description`, while you would have to manually declare two metadata tags when using the `<head>` tag.
:::
:::note
This feature is built on top of the Docusaurus [`<Head>`](./../../docusaurus-core.md#head) component.
Refer to [react-helmet](https://github.com/nfl/react-helmet) for exhaustive documentation.
:::

View file

@ -1,57 +0,0 @@
---
id: headings
title: Headings
description: Using Markdown headings
slug: /markdown-features/headings
---
## Markdown headings {#markdown-headings}
You can use regular Markdown headings.
```
## Level 2 title
### Level 3 title
#### Level 4 title
```
Markdown headings appear as a table of contents entry.
## Heading ids {#heading-ids}
Each heading has an id that can be automatically generated or explicitly specified.
Heading ids allow you to link to a specific document heading in Markdown or JSX:
```md
[link](#heading-id)
```
```jsx
<Link to="#heading-id">link</Link>
```
### Generated ids {#generated-ids}
By default, Docusaurus will generate heading ids for you, based on the heading text. For example, `### Hello World` will have id `hello-world`.
Generated ids have **some limits**:
- The id might not look good
- You might want to **change or translate** the text without updating the existing id
### Explicit ids {#explicit-ids}
A special Markdown syntax lets you set an **explicit heading id**:
```md
### Hello World {#my-explicit-id}
```
:::tip
Use the **[write-heading-ids](../../cli.md#docusaurus-write-heading-ids-sitedir)** CLI command to add explicit ids to all your Markdown documents.
:::

View file

@ -1,173 +0,0 @@
---
id: inline-toc
title: Inline TOC
description: Using inline table-of-contents inside Docusaurus Markdown
slug: /markdown-features/inline-toc
---
import BrowserWindow from '@site/src/components/BrowserWindow';
Each Markdown document displays a tab of content on the top-right corner.
But it is also possible to display an inline table of contents directly inside a markdown document, thanks to MDX.
## Full table of contents {#full-table-of-contents}
The `toc` variable is available in any MDX document and contains all the headings of an MDX document.
By default, only `h2` and `h3` headings are displayed in the TOC. You can change which heading levels are visible by setting `minHeadingLevel` or `maxHeadingLevel`.
```jsx
import TOCInline from '@theme/TOCInline';
<TOCInline toc={toc} />;
```
```mdx-code-block
import TOCInline from '@theme/TOCInline';
<BrowserWindow>
<TOCInline toc={toc} />
</BrowserWindow>
```
## Custom table of contents {#custom-table-of-contents}
The `toc` prop is just a list of heading items:
```ts
type TOCItem = {
value: string;
id: string;
level: number;
};
```
Note that the `toc` global is a flat array, so you can easily cut out unwanted nodes or insert extra nodes, and create a new TOC tree.
```jsx
import TOCInline from '@theme/TOCInline';
<TOCInline
// Only show h2 and h4 headings
toc={toc.filter((node) => node.level === 2 || node.level === 4)}
/>;
```
```mdx-code-block
<BrowserWindow>
<TOCInline toc={toc.filter((node) => node.level === 2 || node.level === 4)} />
</BrowserWindow>
```
---
:::caution
Below is just some dummy content to have more table of contents items available on the current page.
:::
## Example Section 1 {#example-section-1}
Lorem ipsum
### Example Subsection 1 a {#example-subsection-1-a}
Lorem ipsum
#### Example subsubsection 1 a I
#### Example subsubsection 1 a II
#### Example subsubsection 1 a III
### Example Subsection 1 b {#example-subsection-1-b}
Lorem ipsum
#### Example subsubsection 1 b I
#### Example subsubsection 1 b II
#### Example subsubsection 1 b III
### Example Subsection 1 c {#example-subsection-1-c}
Lorem ipsum
#### Example subsubsection 1 c I
#### Example subsubsection 1 c II
#### Example subsubsection 1 c III
## Example Section 2 {#example-section-2}
Lorem ipsum
### Example Subsection 2 a {#example-subsection-2-a}
Lorem ipsum
#### Example subsubsection 2 a I
#### Example subsubsection 2 a II
#### Example subsubsection 2 a III
### Example Subsection 2 b {#example-subsection-2-b}
Lorem ipsum
#### Example subsubsection 2 b I
#### Example subsubsection 2 b II
#### Example subsubsection 2 b III
### Example Subsection 2 c {#example-subsection-2-c}
Lorem ipsum
#### Example subsubsection 2 c I
#### Example subsubsection 2 c II
#### Example subsubsection 2 c III
## Example Section 3 {#example-section-3}
Lorem ipsum
### Example Subsection 3 a {#example-subsection-3-a}
Lorem ipsum
#### Example subsubsection 3 a I
#### Example subsubsection 3 a II
#### Example subsubsection 3 a III
### Example Subsection 3 b {#example-subsection-3-b}
Lorem ipsum
#### Example subsubsection 3 b I
#### Example subsubsection 3 b II
#### Example subsubsection 3 b III
### Example Subsection 3 c {#example-subsection-3-c}
Lorem ipsum
#### Example subsubsection 3 c I
#### Example subsubsection 3 c II
#### Example subsubsection 3 c III

View file

@ -1,3 +1,7 @@
---
description: How the Docusaurus client is structured
---
# Client architecture
## Theme aliases {#theme-aliases}
@ -82,7 +86,7 @@ Client modules are part of your site's bundle, just like theme components. Howev
These modules are imported globally before React even renders the initial UI.
```js title="App.tsx"
```js title="@docusaurus/core/App.tsx"
// How it works under the hood
import '@generated/client-modules';
```
@ -113,5 +117,70 @@ CSS stylesheets imported as client modules are [global](../styling-layout.md#glo
}
```
<!-- TODO client module lifecycles -->
<!-- https://github.com/facebook/docusaurus/issues/3399 -->
### Client module lifecycles {#client-module-lifecycles}
Besides introducing side-effects, client modules can optionally export two lifecycle functions: `onRouteUpdate` and `onRouteDidUpdate`.
Because Docusaurus builds a single-page application, `script` tags will only be executed the first time the page loads, but will not re-execute on page transitions. These lifecycles are useful if you have some imperative JS logic that should execute every time a new page has loaded, e.g., to manipulate DOM elements, to send analytics data, etc.
For every route transition, there will be several important timings:
1. The user clicks a link, which causes the router to change its current location.
2. Docusaurus preloads the next route's assets, while keeping displaying the current page's content.
3. The next route's assets have loaded.
4. The new location's route component gets rendered to DOM.
`onRouteUpdate` will be called at event (2), and `onRouteDidUpdate` will be called at (4). They both receive the current location and the previous location (which can be `null`, if this is the first screen).
`onRouteUpdate` can optionally return a "cleanup" callback, which will be called at (3). For example, if you want to display a progress bar, you can start a timeout in `onRouteUpdate`, and clear the timeout in the callback. (The classic theme already provides an `nprogress` integration this way.)
Note that the new page's DOM is only available during event (4). If you need to manipulate the new page's DOM, you'll likely want to use `onRouteDidUpdate`, which will be fired as soon as the DOM on the new page has mounted.
```js title="myClientModule.js"
import type {Location} from 'history';
export function onRouteDidUpdate({location, previousLocation}) {
// Don't execute if we are still on the same page; the lifecycle may be fired
// because the hash changes (e.g. when navigating between headings)
if (location.pathname !== previousLocation?.pathname) {
const title = document.getElementsByTagName('h1')[0];
if (title) {
title.innerText += '❤️';
}
}
}
export function onRouteUpdate({location, previousLocation}) {
if (location.pathname !== previousLocation?.pathname) {
const progressBarTimeout = window.setTimeout(() => {
nprogress.start();
}, delay);
return () => window.clearTimeout(progressBarTimeout);
}
return undefined;
}
```
Or, if you are using TypeScript and you want to leverage contextual typing:
```ts title="myClientModule.ts"
import type {ClientModule} from '@docusaurus/types';
const module: ClientModule = {
onRouteUpdate({location, previousLocation}) {
// ...
},
onRouteDidUpdate({location, previousLocation}) {
// ...
},
};
export default module;
```
Both lifecycles will fire on first render, but they will not fire on server-side, so you can safely access browser globals in them.
:::tip Prefer using React
Client module lifecycles are purely imperative, and you can't use React hooks or access React contexts within them. If your operations are state-driven or involve complicated DOM manipulations, you should consider [swizzling components](../swizzling.md) instead.
:::

View file

@ -51,7 +51,7 @@ module.exports = {
Then in the folder `my-plugin`, you can create an `index.js` such as this:
```js title="my-plugin.js"
```js title="my-plugin/index.js"
module.exports = async function myPlugin(context, options) {
// ...
return {

View file

@ -257,14 +257,14 @@ If you put some HTML pages under the `static` folder, they will be copied to the
<BrowserWindow>
- <Link data-noBrokenLinkCheck="true" to="/pure-html">/pure-html</Link>
- [/pure-html](/pure-html)
- [pathname:///pure-html](pathname:///pure-html)
</BrowserWindow>
:::tip
The first link will trigger a "broken links detected" check during the production build.
The first link will **not** trigger a "broken links detected" check during the production build, because the respective file actually exists. Nevertheless, when you click on the link, a "page not found" will be displayed until you refresh.
:::

View file

@ -100,6 +100,8 @@ These HTML files are the first to arrive at the user's browser screen when a URL
In CSR-only apps, all DOM elements are generated on client side with React, and the HTML file only ever contains one root element for React to mount DOM to; in SSR, React is already facing a fully built HTML page, and it only needs to correlate the DOM elements with the virtual DOM in its model. This step is called "hydration". After React has hydrated the static markup, the app starts to work as any normal React app.
Note that Docusaurus is ultimately a single-page application, so static site generation is only an optimization (_progressive enhancement_, as it's called), but our functionality does not fully depend on those HTML files. This is contrary to site generators like [Jekyll](https://jekyllrb.com/) and [Docusaurus v1](https://v1.docusaurus.io/), where all files are statically transformed to markup, and interactiveness is added through external JavaScript linked with `<script>` tags. If you inspect the build output, you will still see JS assets under `build/assets/js`, which are, really, the core of Docusaurus.
## Escape hatches {#escape-hatches}
If you want to render any dynamic content on your screen that relies on the browser API to be functional at all, for example:

View file

@ -52,7 +52,7 @@ module.exports = Promise.resolve({
- Type: `string`
Title for your website.
Title for your website. Will be used in metadata and as browser tab title.
```js title="docusaurus.config.js"
module.exports = {
@ -72,11 +72,11 @@ module.exports = {
};
```
### `baseUrl` {#baseurl}
### `baseUrl` {#baseUrl}
- Type: `string`
Base URL for your site. This can also be considered 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.
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 = {
@ -90,7 +90,7 @@ module.exports = {
- Type: `string | undefined`
Path to your site favicon. For example, if your favicon is in `static/img/favicon.ico`:
Path to your site favicon; must be a URL that can be used in link's href. For example, if your favicon is in `static/img/favicon.ico`:
```js title="docusaurus.config.js"
module.exports = {
@ -98,7 +98,7 @@ module.exports = {
};
```
### `trailingSlash` {#trailing-slash}
### `trailingSlash` {#trailingSlash}
- Type: `boolean | undefined`
@ -124,6 +124,8 @@ The i18n configuration object to [localize your site](../i18n/i18n-introduction.
Example:
<!-- cSpell:ignore فارسی -->
```js title="docusaurus.config.js"
module.exports = {
i18n: {
@ -134,26 +136,32 @@ module.exports = {
label: 'English',
direction: 'ltr',
htmlLang: 'en-US',
calendar: 'gregory',
},
fr: {
label: 'Français',
direction: 'ltr',
htmlLang: 'fr-FR',
fa: {
label: 'فارسی',
direction: 'rtl',
htmlLang: 'fa-IR',
calendar: 'persian',
},
},
},
};
```
- `label`: the label to use for this locale
- `direction`: `ltr` (default) or `rtl` (for [right-to-left languages](https://developer.mozilla.org/en-US/docs/Glossary/rtl) like Arabic, Hebrew, etc.)
- `htmlLang`: BCP 47 language tag to use in `<html lang="...">` and in `<link ... hreflang="...">`
- `defaultLocale`: The locale that (1) does not have its name in the base URL (2) gets started with `docusaurus start` without `--locale` option (3) will be used for the `<link hrefLang="x-default">` tag
- `locales`: List of locales deployed on your site. Must contain `defaultLocale`.
- `localeConfigs`: Individual options for each locale.
- `label`: The label displayed for this locale in the locales dropdown.
- `direction`: `ltr` (default) or `rtl` (for [right-to-left languages](https://developer.mozilla.org/en-US/docs/Glossary/rtl) like Arabic, Hebrew, etc.). Used to select the locale's CSS and html meta attribute.
- `htmlLang`: BCP 47 language tag to use in `<html lang="...">` and in `<link ... hreflang="...">`
- `calendar`: the [calendar](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) used to calculate the date era. Note that it doesn't control the actual string displayed: `MM/DD/YYYY` and `DD/MM/YYYY` are both `gregory`. To choose the format (`DD/MM/YYYY` or `MM/DD/YYYY`), set your locale name to `en-GB` or `en-US` (`en` means `en-US`).
### `noIndex` {#noindex}
### `noIndex` {#noIndex}
- Type: `boolean`
This option adds `<meta name="robots" content="noindex, nofollow">` in pages, to tell search engines to avoid indexing your site (more information [here](https://moz.com/learn/seo/robots-meta-directives)).
This option adds `<meta name="robots" content="noindex, nofollow">` to every page to tell search engines to avoid indexing your site (more information [here](https://moz.com/learn/seo/robots-meta-directives)).
Example:
@ -163,11 +171,11 @@ module.exports = {
};
```
### `onBrokenLinks` {#onbrokenlinks}
### `onBrokenLinks` {#onBrokenLinks}
- Type: `'ignore' | 'log' | 'warn' | 'error' | 'throw'`
The behavior of Docusaurus, when it detects any broken link.
The behavior of Docusaurus when it detects any broken link.
By default, it throws an error, to ensure you never ship any broken link, but you can lower this security if needed.
@ -177,15 +185,15 @@ The broken links detection is only available for a production build (`docusaurus
:::
### `onBrokenMarkdownLinks` {#onbrokenmarkdownlinks}
### `onBrokenMarkdownLinks` {#onBrokenMarkdownLinks}
- Type: `'ignore' | 'log' | 'warn' | 'error' | 'throw'`
The behavior of Docusaurus, when it detects any broken markdown link.
The behavior of Docusaurus when it detects any broken markdown link.
By default, it prints a warning, to let you know about your broken markdown link, but you can change this security if needed.
### `onDuplicateRoutes` {#onduplicateroutes}
### `onDuplicateRoutes` {#onDuplicateRoutes}
- Type: `'ignore' | 'log' | 'warn' | 'error' | 'throw'`
@ -206,11 +214,11 @@ module.exports = {
};
```
### `organizationName` {#organizationname}
### `organizationName` {#organizationName}
- Type: `string`
The GitHub user or organization that owns the repository. Used by the deployment command.
The GitHub user or organization that owns the repository. You don't need this if you are not using the `docusaurus deploy` command.
```js title="docusaurus.config.js"
module.exports = {
@ -219,11 +227,11 @@ module.exports = {
};
```
### `projectName` {#projectname}
### `projectName` {#projectName}
- Type: `string`
The name of the GitHub repository. Used by the deployment command.
The name of the GitHub repository. You don't need this if you are not using the `docusaurus deploy` command.
```js title="docusaurus.config.js"
module.exports = {
@ -231,11 +239,11 @@ module.exports = {
};
```
### `deploymentBranch` {#deploymentbranch}
### `deploymentBranch` {#deploymentBranch}
- Type: `string`
The name of the branch to deploy the static files to. Used by the deployment command.
The name of the branch to deploy the static files to. You don't need this if you are not using the `docusaurus deploy` command.
```js title="docusaurus.config.js"
module.exports = {
@ -243,11 +251,11 @@ module.exports = {
};
```
### `githubHost` {#githubhost}
### `githubHost` {#githubHost}
- Type: `string`
The hostname of your server. Useful if you are using GitHub Enterprise.
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 = {
@ -259,7 +267,7 @@ module.exports = {
- Type: `string`
The port of your server. Useful if you are using GitHub Enterprise.
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 = {
@ -267,19 +275,23 @@ module.exports = {
};
```
### `themeConfig` {#themeconfig}
### `themeConfig` {#themeConfig}
- Type: `Object`
The [theme configuration](./themes/theme-configuration.md) object, to customize your site UI like navbar, footer.
The [theme configuration](./themes/theme-configuration.md) object to customize your site UI like navbar and footer.
Example:
```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
hideableSidebar: false,
autoCollapseSidebarCategories: false,
docs: {
sidebar: {
hideable: false,
autoCollapseCategories: false,
},
},
colorMode: {
defaultMode: 'light',
disableSwitch: false,
@ -398,7 +410,7 @@ Attempting to add unknown fields in the config will lead to errors during build
Error: The field(s) 'foo', 'bar' are not recognized in docusaurus.config.js
```
### `staticDirectories` {#staticdirectories}
### `staticDirectories` {#staticDirectories}
An array of paths, relative to the site's directory or absolute. Files under these paths will be copied to the build output as-is.
@ -416,7 +428,7 @@ module.exports = {
An array of scripts to load. The values can be either strings or plain objects of attribute-value maps. The `<script>` tags will be inserted in the HTML `<head>`.
Note that `<script>` added here are render-blocking so you might want to add `async: true`/`defer: true` to the objects.
Note that `<script>` added here are render-blocking, so you might want to add `async: true`/`defer: true` to the objects.
- Type: `(string | Object)[]`
@ -436,9 +448,30 @@ module.exports = {
};
```
### `clientModules` {#clientmodules}
### `stylesheets` {#stylesheets}
An array of [client modules](../advanced/client.md#client-modules) to load globally on your site:
An array of CSS sources to load. The values can be either strings or plain objects of attribute-value maps. The `<link>` tags will be inserted in the HTML `<head>`.
- Type: `(string | Object)[]`
Example:
```js title="docusaurus.config.js"
module.exports = {
stylesheets: [
// String format.
'https://docusaurus.io/style.css',
// Object format.
{
href: 'http://mydomain.com/style.css',
},
],
};
```
### `clientModules` {#clientModules}
An array of [client modules](../advanced/client.md#client-modules) to load globally on your site.
Example:
@ -451,9 +484,9 @@ module.exports = {
};
```
### `ssrTemplate` {#ssrtemplate}
### `ssrTemplate` {#ssrTemplate}
An HTML template written in [Eta's syntax](https://eta.js.org/docs/syntax#syntax-overview) that will be used to render your application. This can be used to set custom attributes on the `body` tags, additional `meta` tags, customize the `viewport`, etc. Please note that Docusaurus will rely on the template to be correctly structured in order to function properly, once you do customize it, you will have to make sure that your template is compliant with the requirements from `upstream`.
An HTML template written in [Eta's syntax](https://eta.js.org/docs/syntax#syntax-overview) that will be used to render your application. This can be used to set custom attributes on the `body` tags, additional `meta` tags, customize the `viewport`, etc. Please note that Docusaurus will rely on the template to be correctly structured in order to function properly, once you do customize it, you will have to make sure that your template is compliant with the requirements from upstream.
- Type: `string`
@ -495,32 +528,11 @@ module.exports = {
};
```
### `stylesheets` {#stylesheets}
An array of CSS sources to load. The values can be either strings or plain objects of attribute-value maps. The `<link>` tags will be inserted in the HTML `<head>`.
- Type: `(string | Object)[]`
Example:
```js title="docusaurus.config.js"
module.exports = {
stylesheets: [
// String format.
'https://docusaurus.io/style.css',
// Object format.
{
href: 'http://mydomain.com/style.css',
},
],
};
```
### `titleDelimiter` {#titledelimiter}
### `titleDelimiter` {#titleDelimiter}
- Type: `string`
A string that will be used as title delimiter in the generated `<title>` tag.
Will be used as title delimiter in the generated `<title>` tag.
Example:
@ -530,7 +542,7 @@ module.exports = {
};
```
### `baseUrlIssueBanner` {#baseurlissuebanner}
### `baseUrlIssueBanner` {#baseurlIssueBanner}
- Type: `boolean`

View file

@ -0,0 +1,2 @@
label: Miscellaneous
position: 4

View file

@ -0,0 +1,74 @@
---
sidebar_position: 0
id: eslint-plugin
title: '📦 eslint-plugin'
slug: '/api/misc/@docusaurus/eslint-plugin'
---
[ESLint](https://eslint.org/) is a tool that statically analyzes your code and reports problems or suggests best practices through editor hints and command line. Docusaurus provides an ESLint plugin to enforce best Docusaurus practices.
## Installation
```bash npm2yarn
npm install --save-dev @docusaurus/eslint-plugin
```
## Usage
Add `@docusaurus` to the plugins section of your `.eslintrc` configuration file:
```json title=".eslintrc"
{
"plugins": ["@docusaurus"]
}
```
Then, you can extend one of the configs (e.g. the `recommended` config):
```json title=".eslintrc"
{
"extends": ["plugin:@docusaurus/recommended"]
}
```
Each config contains a set of rules. For more fine-grained control, you can also configure the rules you want to use directly:
```json title=".eslintrc"
{
"rules": {
"@docusaurus/string-literal-i18n-messages": "error",
"@docusaurus/no-untranslated-text": "warn"
}
}
```
## Supported Configs
- Recommended: recommended rule set for most Docusaurus sites that should be extended from.
- All: **all** rules enabled. This will change between minor versions, so you should not use this if you want to avoid unexpected breaking changes.
## Supported Rules
| Name | Description | |
| --- | --- | --- |
| [`@docusaurus/no-untranslated-text`](./no-untranslated-text.md) | Enforce text labels in JSX to be wrapped by translate calls | |
| [`@docusaurus/string-literal-i18n-messages`](./string-literal-i18n-messages.md) | Enforce translate APIs to be called on plain text labels | ✅ |
✅ = recommended
## Example configuration
Here's an example configuration:
```js title=".eslintrc.js"
module.exports = {
extends: ['plugin:@docusaurus/recommended'],
plugins: ['@docusaurus'],
rules: {
'@docusaurus/no-untranslated-text': [
'warn',
{ignoredStrings: ['·', '—', '×']},
],
},
};
```

View file

@ -0,0 +1,48 @@
---
slug: '/api/misc/@docusaurus/eslint-plugin/no-untranslated-text'
---
# no-untranslated-text
Enforce text labels in JSX to be wrapped by translate calls.
When the [i18n feature](../../../i18n/i18n-introduction.md) is used, this rule ensures that all labels appearing on the website are translatable, so no string accidentally slips through untranslated.
## Rule Details {#details}
Examples of **incorrect** code for this rule:
```js
// Hello World is not translated
<Component>Hello World</Component>
```
Examples of **correct** code for this rule:
```js
// Hello World is translated
<Component>
<Translate>Hello World</Translate>
</Component>
```
## Rule Configuration {#configuration}
Accepted fields:
<APITable>
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `ignoredStrings` | `string[]` | `[]` | Text labels that only contain strings in this list will not be reported. |
</APITable>
## When Not To Use It {#when-not-to-use}
If you're not using the [i18n feature](../../../i18n/i18n-introduction.md), you can disable this rule. You can also disable this rule where the text is not supposed to be translated.
## Further Reading {#further-reading}
- https://docusaurus.io/docs/docusaurus-core#translate
- https://docusaurus.io/docs/docusaurus-core#translate-imperative

View file

@ -0,0 +1,50 @@
---
slug: '/api/misc/@docusaurus/eslint-plugin/string-literal-i18n-messages'
---
# string-literal-i18n-messages
Enforce translate APIs to be called on plain text labels.
Docusaurus offers the [`docusaurus write-translations`](../../../cli.md#docusaurus-write-translations-sitedir) API, which statically extracts the text labels marked as translatable. Dynamic values used in `<Translate>` or `translate()` calls will fail to be extracted. This rule will ensure that all translate calls are statically extractable.
## Rule Details {#details}
Examples of **incorrect** code for this rule:
```js
const text = 'Some text to be translated'
// Invalid <Translate> child
<Translate>{text}</Translate>
// Invalid message attribute
translate({message: text})
```
Examples of **correct** code for this rule:
```js
// Valid <Translate> child
<Translate>Some text to be translated</Translate>
// Valid message attribute
translate({message: 'Some text to be translated'})
// Valid <Translate> child using values object as prop
<Translate values={{firstName: 'Sébastien'}}>
{'Welcome, {firstName}! How are you?'}
</Translate>
// Valid message attribute using values object as second argument
translate({message: 'The logo of site {siteName}'}, {siteName: 'Docusaurus'})
```
## When Not To Use It {#when-not-to-use}
If you're not using the [i18n feature](../../../i18n/i18n-introduction.md), you can disable this rule.
## Further Reading {#further-reading}
- https://docusaurus.io/docs/docusaurus-core#translate
- https://docusaurus.io/docs/docusaurus-core#translate-imperative

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View file

@ -0,0 +1,67 @@
---
sidebar_position: 1
title: '📦 logger'
slug: '/api/plugins/@docusaurus/logger'
---
An encapsulated logger for semantically formatting console messages.
Authors of packages in the Docusaurus ecosystem are encouraged to use this package to provide unified log formats.
## APIs
It exports a single object as default export: `logger`. `logger` has the following properties:
- Some useful colors.
- `red`
- `yellow`
- `green`
- `bold`
- `dim`
- Formatters. These functions all have the signature `(msg: unknown) => string`. Note that their implementations are not guaranteed. You should only care about their semantics.
- `path`: formats a file path.
- `url`: formats a URL.
- `name`: formats an identifier.
- `code`: formats a code snippet.
- `subdue`: subdues the text.
- `num`: formats a number.
- The `interpolate` function. It is a template literal tag. The syntax can be found below.
- Logging functions. All logging functions can both be used as normal functions (similar to the `console.log` family, but only accepts one parameter) or template literal tags.
- `info`: prints information.
- `warn`: prints a warning that should be payed attention to.
- `error`: prints an error (not necessarily halting the program) that signals significant problems.
- `success`: prints a success message.
:::caution A word on the `error` formatter
Beware that an `error` message, even when it doesn't hang the program, is likely going to cause confusion. When users inspect logs and find an `[ERROR]`, even when the build succeeds, they will assume something is going wrong. Use it sparingly.
Docusaurus only uses `logger.error` when printing messages immediately before throwing an error, or when user has set the reporting severity of `onBrokenLink`, etc. to `"error"`.
In addition, `warn` and `error` will color the **entire** message for better attention. If you are printing large blocks of help text about an error, better use `logger.info`.
:::
### Using the template literal tag
The template literal tag evaluates the template and expressions embedded. `interpolate` returns a new string, while other logging functions prints it. Below is a typical usage:
```js
logger.info`Hello name=${name}! You have number=${money} dollars. Here are the ${
items.length > 1 ? 'items' : 'item'
} on the shelf: ${items}
To buy anything, enter code=${'buy x'} where code=${'x'} is the item's name; to quit, press code=${'Ctrl + C'}.`;
```
An embedded expression is optionally preceded by a flag in the form `[a-z]+=` (a few lowercase letters, followed by an equals sign, directly preceding the embedded expression). If the expression is not preceded by any flag, it's printed out as-is. Otherwise, it's formatted with one of the formatters:
- `path=`: `path`
- `url=`: `url`
- `name=`: `name`
- `code=`: `code`
- `subdue=`: `subdue`
- `number=`: `num`
If the expression is an array, it's formatted by `` `\n- ${array.join('\n- ')}\n` `` (note it automatically gets a leading line end). Each member is formatted by itself and the bullet is not formatted. So you would see the above message printed as:
![demo](./img/logger-demo.png)

View file

@ -24,13 +24,13 @@ The plugin module's default export is a constructor function with the signature
`context` is plugin-agnostic, and the same object will be passed into all plugins used for a Docusaurus website. The `context` object contains the following fields:
```ts
interface LoadContext {
type LoadContext = {
siteDir: string;
generatedFilesDir: string;
siteConfig: DocusaurusConfig;
outDir: string;
baseUrl: string;
}
};
```
### `options` {#options}

View file

@ -61,7 +61,7 @@ module.exports = function (context, options) {
## `getThemePath()` {#getThemePath}
Returns the path to the directory where the theme components can be found. When your users call `swizzle`, `getThemePath` is called and its returned path is used to find your theme components.
Returns the path to the directory where the theme components can be found. When your users call `swizzle`, `getThemePath` is called and its returned path is used to find your theme components. Relative paths are resolved against the folder containing the entry point.
For example, your `getThemePath` can be:
@ -73,7 +73,7 @@ module.exports = function (context, options) {
name: 'my-theme',
// highlight-start
getThemePath() {
return path.resolve(__dirname, './theme');
return './theme';
},
// highlight-end
};
@ -103,11 +103,11 @@ module.exports = function (context, options) {
// highlight-start
getThemePath() {
// Where compiled JavaScript output lives
return path.join(__dirname, '../lib/theme');
return '../lib/theme';
},
getTypeScriptThemePath() {
// Where TypeScript source code lives
return path.resolve(__dirname, '../src/theme');
return '../src/theme';
},
// highlight-end
};

View file

@ -43,17 +43,17 @@ The data that was loaded in `loadContent` will be consumed in `contentLoaded`. I
Create a route to add to the website.
```ts
interface RouteConfig {
type RouteConfig = {
path: string;
component: string;
modules?: RouteModule;
modules?: RouteModules;
routes?: RouteConfig[];
exact?: boolean;
priority?: number;
}
interface RouteModule {
[module: string]: Module | RouteModule | RouteModule[];
}
};
type RouteModules = {
[module: string]: Module | RouteModules | RouteModules[];
};
type Module =
| {
path: string;
@ -233,6 +233,27 @@ module.exports = function (context, options) {
Read the [webpack-merge strategy doc](https://github.com/survivejs/webpack-merge#merging-with-strategies) for more details.
### Configuring dev server {#configuring-dev-server}
The dev server can be configured through returning a `devServer` field.
```js title="docusaurus-plugin/src/index.js"
module.exports = function (context, options) {
return {
name: 'custom-docusaurus-plugin',
configureWebpack(config, isServer, utils) {
return {
// highlight-start
devServer: {
open: '/docs', // Opens localhost:3000/docs instead of localhost:3000/
},
// highlight-end
};
},
};
};
```
## `configurePostCss(options)` {#configurePostCss}
Modifies [`postcssOptions` of `postcss-loader`](https://webpack.js.org/loaders/postcss-loader/#postcssoptions) during the generation of the client bundle.
@ -318,7 +339,7 @@ function injectHtmlTags(): {
type HtmlTags = string | HtmlTagObject | (string | HtmlTagObject)[];
interface HtmlTagObject {
type HtmlTagObject = {
/**
* Attributes of the HTML tag
* E.g. `{'disabled': true, 'value': 'demo', 'rel': 'preconnect'}`
@ -334,7 +355,7 @@ interface HtmlTagObject {
* The inner HTML
*/
innerHTML?: string;
}
};
```
Example:

View file

@ -37,32 +37,32 @@ Accepted fields:
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `path` | `string` | `'blog'` | Path to the blog content directory on the filesystem, relative to site dir. |
| `editUrl` | <code>string \| EditUrlFunction</code> | `undefined` | Base URL to edit your site. The final URL is computed by `editUrl + relativeDocPath`. Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links. |
| `path` | `string` | `'blog'` | Path to the blog content directory on the file system, relative to site dir. |
| `editUrl` | <code>string \| EditUrlFunction</code> | `undefined` | Base URL to edit your site. The final URL is computed by `editUrl + relativePostPath`. Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links. |
| `editLocalizedFiles` | `boolean` | `false` | The edit URL will target the localized file, instead of the original unlocalized file. Ignored when `editUrl` is a function. |
| `blogTitle` | `string` | `'Blog'` | Blog page title for better SEO. |
| `blogDescription` | `string` | `'Blog'` | Blog page meta description for better SEO. |
| `blogSidebarCount` | <code>number \| 'ALL'</code> | `5` | Number of blog post elements to show in the blog sidebar. `'ALL'` to show all blog posts; `0` to disable |
| `blogSidebarCount` | <code>number \| 'ALL'</code> | `5` | Number of blog post elements to show in the blog sidebar. `'ALL'` to show all blog posts; `0` to disable. |
| `blogSidebarTitle` | `string` | `'Recent posts'` | Title of the blog sidebar. |
| `routeBasePath` | `string` | `'blog'` | URL route for the blog section of your site. **DO NOT** include a trailing slash. Use `/` to put the blog at root path. |
| `tagsBasePath` | `string` | `'tags'` | URL route for the tags list page of your site. It is prepended to the `routeBasePath`. |
| `archiveBasePath` | <code>string \| null</code> | `'/archive'` | URL route for the archive blog section of your site. It is prepended to the `routeBasePath`. **DO NOT** include a trailing slash. Use `null` to disable generation of archive. |
| `include` | `string[]` | `['**/*.{md,mdx}']` | Matching files will be included and processed. |
| `exclude` | `string[]` | _See example configuration_ | No route will be created for matching files. |
| `tagsBasePath` | `string` | `'tags'` | URL route for the tags section of your blog. Will be appended to `routeBasePath`. **DO NOT** include a trailing slash. |
| `archiveBasePath` | <code>string \| null</code> | `'archive'` | URL route for the archive section of your blog. Will be appended to `routeBasePath`. **DO NOT** include a trailing slash. Use `null` to disable generation of archive. |
| `include` | `string[]` | `['**/*.{md,mdx}']` | Array of glob patterns matching Markdown files to be built, relative to the content path. |
| `exclude` | `string[]` | _See example configuration_ | Array of glob patterns matching Markdown files to be excluded. Serves as refinement based on the `include` option. |
| `postsPerPage` | <code>number \| 'ALL'</code> | `10` | Number of posts to show per page in the listing page. Use `'ALL'` to display all posts on one listing page. |
| `blogListComponent` | `string` | `'@theme/BlogListPage'` | Root component of the blog listing page. |
| `blogPostComponent` | `string` | `'@theme/BlogPostPage'` | Root component of each blog post page. |
| `blogTagsListComponent` | `string` | `'@theme/BlogTagsListPage'` | Root component of the tags list page |
| `blogTagsListComponent` | `string` | `'@theme/BlogTagsListPage'` | Root component of the tags list page. |
| `blogTagsPostsComponent` | `string` | `'@theme/BlogTagsPostsPage'` | Root component of the "posts containing tag" page. |
| `blogArchiveComponent` | `string` | `'@theme/BlogArchivePage'` | Root component of the blog archive page. |
| `remarkPlugins` | `any[]` | `[]` | Remark plugins passed to MDX. |
| `rehypePlugins` | `any[]` | `[]` | Rehype plugins passed to MDX. |
| `beforeDefaultRemarkPlugins` | `any[]` | `[]` | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins. |
| `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. |
| `truncateMarker` | `RegExp` | `/<!--\s*(truncate)\s*-->/` | Truncate marker marking where the summary ends. |
| `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. |
| `authorsMapPath` | `string` | `'authors.yml'` | Path to the authors map file, relative to the blog content directory. |
| `feedOptions` | _See below_ | `{type: ['rss', 'atom']}` | Blog feed. |
| `feedOptions.type` | <code>FeedType \| FeedType[] \| 'all' \| null</code> | **Required** | Type of feed to be generated. Use `null` to disable generation. |
| `feedOptions.title` | `string` | `siteConfig.title` | Title of the feed. |
@ -174,7 +174,7 @@ Accepted fields:
| `title` | `string` | Markdown title | The blog post title. |
| `date` | `string` | File name or file creation time | The blog post creation date. If not specified, this can be extracted from the file or folder name, e.g, `2021-04-15-blog-post.mdx`, `2021-04-15-blog-post/index.mdx`, `2021/04/15/blog-post.mdx`. Otherwise, it is the Markdown file creation time. |
| `tags` | `Tag[]` | `undefined` | A list of strings or objects of two string fields `label` and `permalink` to tag to your post. |
| `draft` | `boolean` | `false` | A boolean flag to indicate that the blog post is work-in-progress and therefore should not be published yet. However, draft blog posts will be displayed during development. |
| `draft` | `boolean` | `false` | A boolean flag to indicate that the blog post is work-in-progress. Draft blog posts will only be displayed during development. |
| `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. |

View file

@ -31,24 +31,23 @@ Accepted fields:
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `path` | `string` | `'docs'` | Path to data on filesystem relative to site dir. |
| `breadcrumbs` | `boolean` | `true` | To enable or disable the breadcrumbs on docs pages. |
| `path` | `string` | `'docs'` | Path to the docs content directory on the file system, relative to site directory. |
| `editUrl` | <code>string \| EditUrlFunction</code> | `undefined` | Base URL to edit your site. The final URL is computed by `editUrl + relativeDocPath`. Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links. |
| `editLocalizedFiles` | `boolean` | `false` | The edit URL will target the localized file, instead of the original unlocalized file. Ignored when `editUrl` is a function. |
| `editCurrentVersion` | `boolean` | `false` | The edit URL will always target the current version doc instead of older versions. Ignored when `editUrl` is a function. |
| `routeBasePath` | `string` | `'docs'` | URL route for the docs section of your site. **DO NOT** include a trailing slash. Use `/` for shipping docs without base path. |
| `tagsBasePath` | `string` | `'tags'` | URL route for the tags list page of your site. It is prepended to the `routeBasePath`. |
| `include` | `string[]` | `['**/*.{md,mdx}']` | Matching files will be included and processed. |
| `exclude` | `string[]` | _See example configuration_ | No route will be created for matching files. |
| `sidebarPath` | <code>false \| string</code> | `undefined` (creates autogenerated sidebar) | Path to sidebar configuration. |
| `include` | `string[]` | `['**/*.{md,mdx}']` | Array of glob patterns matching Markdown files to be built, relative to the content path. |
| `exclude` | `string[]` | _See example configuration_ | Array of glob patterns matching Markdown files to be excluded. Serves as refinement based on the `include` option. |
| `sidebarPath` | <code>false \| string</code> | `undefined` | Path to sidebar configuration. Use `false` to disable sidebars, or `undefined` to create a fully autogenerated sidebar. |
| `sidebarCollapsible` | `boolean` | `true` | Whether sidebar categories are collapsible by default. See also [Collapsible categories](/docs/sidebar#collapsible-categories) |
| `sidebarCollapsed` | `boolean` | `true` | Whether sidebar categories are collapsed by default. See also [Expanded categories by default](/docs/sidebar#expanded-categories-by-default) |
| `sidebarItemsGenerator` | `SidebarGenerator` | _Omitted_ | Function used to replace the sidebar items of type `'autogenerated'` by real sidebar items (docs, categories, links...). See also [Customize the sidebar items generator](/docs/sidebar#customize-the-sidebar-items-generator) |
| `sidebarItemsGenerator` | `SidebarGenerator` | _Omitted_ | Function used to replace the sidebar items of type `'autogenerated'` with real sidebar items (docs, categories, links...). See also [Customize the sidebar items generator](/docs/sidebar#customize-the-sidebar-items-generator) |
| `numberPrefixParser` | <code>boolean \| PrefixParser</code> | _Omitted_ | Custom parsing logic to extract number prefixes from file names. Use `false` to disable this behavior and leave the docs untouched, and `true` to use the default parser. See also [Using number prefixes](/docs/sidebar#using-number-prefixes) |
| `docLayoutComponent` | `string` | `'@theme/DocPage'` | Root Layout component of each doc page. |
| `docLayoutComponent` | `string` | `'@theme/DocPage'` | Root layout component of each doc page. Provides the version data context, and is not unmounted when switching docs. |
| `docItemComponent` | `string` | `'@theme/DocItem'` | Main doc container, with TOC, pagination, etc. |
| `docTagsListComponent` | `string` | `'@theme/DocTagsListPage'` | Root component of the tags list page |
| `docTagDocListComponent` | `string` | `'@theme/DocTagDocListPage'` | Root component of the "docs containing tag" page. |
| `docTagDocListComponent` | `string` | `'@theme/DocTagDocListPage'` | Root component of the "docs containing tag X" page. |
| `docCategoryGeneratedIndexComponent` | `string` | `'@theme/DocCategoryGeneratedIndexPage'` | Root component of the generated category index page. |
| `remarkPlugins` | `any[]` | `[]` | Remark plugins passed to MDX. |
| `rehypePlugins` | `any[]` | `[]` | Rehype plugins passed to MDX. |
@ -56,11 +55,12 @@ Accepted fields:
| `beforeDefaultRehypePlugins` | `any[]` | `[]` | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins. |
| `showLastUpdateAuthor` | `boolean` | `false` | Whether to display the author who last updated the doc. |
| `showLastUpdateTime` | `boolean` | `false` | Whether to display the last date the doc was updated. |
| `disableVersioning` | `boolean` | `false` | Explicitly disable versioning even with versions. This will make the site only include the current version. |
| `breadcrumbs` | `boolean` | `true` | Enable or disable the breadcrumbs on doc pages. |
| `disableVersioning` | `boolean` | `false` | Explicitly disable versioning even when multiple versions exist. This will make the site only include the current version. Will error if `includeCurrentVersion: false` and `disableVersioning: true`. |
| `includeCurrentVersion` | `boolean` | `true` | Include the current version of your docs. |
| `lastVersion` | `string` | First version in `versions.json` | Set the version navigated to in priority and displayed by default for docs navbar items. |
| `lastVersion` | `string` | First version in `versions.json` | The version navigated to in priority and displayed by default for docs navbar items. |
| `onlyIncludeVersions` | `string[]` | All versions available | Only include a subset of all available versions. |
| `versions` | `Versions` | `{}` | Independent customization of each version's properties. |
| `versions` | `VersionsConfig` | `{}` | Independent customization of each version's properties. |
</APITable>
@ -78,38 +78,65 @@ type PrefixParser = (filename: string) => {
numberPrefix?: number;
};
type CategoryIndexMatcher = (doc: {
type CategoryIndexMatcher = (param: {
/** The file name, without extension */
fileName: string;
/**
* The list of directories, from lowest level to highest.
* If there's no dir name, directories is ['.']
*/
directories: string[];
/** The extension, with a leading dot */
extension: string;
}) => boolean;
type SidebarGenerator = (generatorArgs: {
item: {type: 'autogenerated'; dirName: string}; // the sidebar item with type "autogenerated"
version: {contentPath: string; versionName: string}; // the current version
/** The sidebar item with type "autogenerated" to be transformed. */
item: {type: 'autogenerated'; dirName: string};
/** Useful metadata for the version this sidebar belongs to. */
version: {contentPath: string; versionName: string};
/** All the docs of that version (unfiltered). */
docs: Array<{
id: string;
title: string;
frontMatter: DocFrontMatter & Record<string, unknown>;
source: string;
sourceDirName: string;
sidebarPosition?: number | undefined;
}>; // all the docs of that version (unfiltered)
numberPrefixParser: PrefixParser; // numberPrefixParser configured for this plugin
categoriesMetadata: Record<string, CategoryMetadata>; // key is the path relative to the doc directory, value is the category metadata file's content
isCategoryIndex: CategoryIndexMatcher; // the default category index matcher, that you can override
defaultSidebarItemsGenerator: SidebarGenerator; // useful to re-use/enhance default sidebar generation logic from Docusaurus
}>;
/** Number prefix parser configured for this plugin. */
numberPrefixParser: PrefixParser;
/** The default category index matcher which you can override. */
isCategoryIndex: CategoryIndexMatcher;
/**
* key is the path relative to the doc content directory, value is the
* category metadata file's content.
*/
categoriesMetadata: {[filePath: string]: CategoryMetadata};
/**
* Useful to re-use/enhance the default sidebar generation logic from
* Docusaurus.
*/
defaultSidebarItemsGenerator: SidebarGenerator;
}) => Promise<SidebarItem[]>;
type Versions = Record<
string, // the version's ID
{
label: string; // the label of the version
path: string; // the route path of the version
banner: 'none' | 'unreleased' | 'unmaintained'; // the banner to show at the top of a doc of that version
badge: boolean; // show a badge with the version name at the top of a doc of that version
className; // add a custom className to the <html> element when browsing docs of that version
}
>;
type VersionsConfig = {
[versionName: string]: {
/**
* The base path of the version, will be appended to `baseUrl` +
* `routeBasePath`.
*/
path?: string;
/** The label of the version to be used in badges, dropdowns, etc. */
label?: string;
/** The banner to show at the top of a doc of that version. */
banner?: 'none' | 'unreleased' | 'unmaintained';
/** Show a badge with the version label at the top of each doc. */
badge?: boolean;
/** Add a custom class name to the <html> element of each doc */
className?: string;
};
};
```
### Example configuration {#ex-config}
@ -235,6 +262,7 @@ Accepted fields:
| `image` | `string` | `undefined` | Cover or thumbnail image that will be used when displaying the link to your post. |
| `slug` | `string` | File path | Allows to customize the document url (`/<routeBasePath>/<slug>`). Support multiple patterns: `slug: my-doc`, `slug: /my/path/myDoc`, `slug: /`. |
| `tags` | `Tag[]` | `undefined` | A list of strings or objects of two string fields `label` and `permalink` to tag to your docs. |
| `draft` | `boolean` | `false` | A boolean flag to indicate that a document is a work-in-progress. Draft documents will only be displayed during development. |
</APITable>

View file

@ -63,7 +63,7 @@ Most Docusaurus users configure this plugin through the preset options.
// Plugin Options: @docusaurus/plugin-google-gtag
const config = {
trackingID: '141789564',
trackingID: 'G-226F0LR9KE',
anonymizeIP: true,
};
```

View file

@ -39,6 +39,7 @@ Accepted fields:
| --- | --- | --- | --- |
| `changefreq` | `string` | `'weekly'` | See [sitemap docs](https://www.sitemaps.org/protocol.html#xmlTagDefinitions) |
| `priority` | `number` | `0.5` | See [sitemap docs](https://www.sitemaps.org/protocol.html#xmlTagDefinitions) |
| `ignorePatterns` | `string[]` | `[]` | A list of glob patterns; matching route paths will be filtered from the sitemap. Note that you may need to include the base URL in here. |
</APITable>
@ -46,8 +47,8 @@ Accepted fields:
This plugin also respects some site config:
- [`noIndex`](../docusaurus.config.js.md#noindex): results in no sitemap generated
- [`trailingSlash`](../docusaurus.config.js.md#trailing-slash): determines if the URLs in the sitemap have trailing slashes
- [`noIndex`](../docusaurus.config.js.md#noIndex): results in no sitemap generated
- [`trailingSlash`](../docusaurus.config.js.md#trailingSlash): determines if the URLs in the sitemap have trailing slashes
:::
@ -68,6 +69,7 @@ Most Docusaurus users configure this plugin through the preset options.
const config = {
changefreq: 'weekly',
priority: 0.5,
ignorePatterns: ['/tags/**'],
};
```

View file

@ -259,6 +259,7 @@ Accepted fields:
| --- | --- | --- | --- |
| `type` | `'default'` | Optional | Sets the type of this item to a link. |
| `label` | `string` | **Required** | The name to be shown for this item. |
| `html` | `string` | Optional | Same as `label`, but renders pure HTML instead of text content. |
| `to` | `string` | **Required** | Client-side routing, used for navigating within the website. The baseUrl will be automatically prepended to this value. |
| `href` | `string` | **Required** | A full-page navigation, used for navigating outside of the website. **Only one of `to` or `href` should be used.** |
| `prependBaseUrlToHref` | `boolean` | `false` | Prepends the baseUrl to `href` values. |
@ -288,6 +289,8 @@ module.exports = {
// Only one of "to" or "href" should be used
// href: 'https://www.facebook.com',
label: 'Introduction',
// Only one of "label" or "html" should be used
// html: '<b>Introduction</b>'
position: 'left',
activeBaseRegex: 'docs/(next|v8)',
target: '_blank',
@ -309,6 +312,7 @@ Navbar dropdown items only accept the following **"link-like" item types**:
- [Navbar doc link](#navbar-doc-link)
- [Navbar docs version](#navbar-docs-version)
- [Navbar doc sidebar](#navbar-doc-sidebar)
- [Navbar with custom HTML](#navbar-with-custom-html)
Note that the dropdown base item is a clickable link as well, so this item can receive any of the props of a [plain navbar link](#navbar-link).
@ -618,6 +622,39 @@ module.exports = {
};
```
#### Navbar with custom HTML {#navbar-with-custom-html}
You can also render your own HTML markup inside a navbar item using this navbar item type.
<APITable name="navbar-html">
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `type` | `'html'` | **Required** | Sets the type of this item to a HTML element. |
| `position` | <code>'left' \| 'right'</code> | `'left'` | The side of the navbar this item should appear on. |
| `className` | `string` | `''` | Custom CSS class for this navbar item. |
| `value` | `string` | `''` | Custom HTML to be rendered inside this navbar item. |
</APITable>
```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'html',
position: 'right',
value: '<button>Give feedback</button>',
},
// highlight-end
],
},
},
};
```
### Auto-hide sticky navbar {#auto-hide-sticky-navbar}
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.
@ -663,9 +700,28 @@ Accepted fields:
| `theme` | `PrismTheme` | `palenight` | The Prism theme to use for light-theme code blocks. |
| `darkTheme` | `PrismTheme` | `palenight` | The Prism theme to use for dark-theme code blocks. |
| `defaultLanguage` | `string` | `undefined` | The side of the navbar this item should appear on. |
| `magicComments` | `MagicCommentConfig[]` | _see below_ | The list of [magic comments](../../guides/markdown-features/markdown-features-code-blocks.mdx#custom-magic-comments). |
</APITable>
```ts
type MagicCommentConfig = {
className: string;
line?: string;
block?: {start: string; end: string};
};
```
```js
const defaultMagicComments = [
{
className: 'theme-code-block-highlighted-line',
line: 'highlight-next-line',
block: {start: 'highlight-start', end: 'highlight-end'},
},
];
```
### Theme {#theme}
By default, we use [Palenight](https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/themes/palenight.js) as syntax highlighting theme. You can specify a custom theme from the [list of available themes](https://github.com/FormidableLabs/prism-react-renderer/tree/master/src/themes). You may also use a different syntax highlighting theme when the site is in dark mode.
@ -901,9 +957,9 @@ import {useColorMode} from '@docusaurus/theme-common';
const Example = () => {
// highlight-next-line
const {isDarkTheme, setLightTheme, setDarkTheme} = useColorMode();
const {colorMode, setColorMode} = useColorMode();
return <h1>Dark mode is now {isDarkTheme ? 'on' : 'off'}</h1>;
return <h1>Dark mode is now {colorMode === 'dark' ? 'on' : 'off'}</h1>;
};
```

View file

@ -50,6 +50,16 @@ Please note that some functionality (for example, anchor links) will not work in
:::
:::info Development over network
When forwarding port 3000 from a remote server or VM (e.g. GitHub Codespaces), you can run the dev server on `0.0.0.0` to make it listen on the local IP.
```bash npm2yarn
npm run start -- --host 0.0.0.0
```
:::
#### Enabling HTTPS {#enabling-https}
There are multiple ways to obtain a certificate. We will use [mkcert](https://github.com/FiloSottile/mkcert) as an example.
@ -161,7 +171,7 @@ By default, the files are written in `website/i18n/<defaultLocale>/...`.
### `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.
Add [explicit heading ids](./guides/markdown-features/markdown-features-toc.mdx#explicit-ids) to the Markdown documents of your site.
| Name | Default | Description |
| --- | --- | --- |

View file

@ -44,7 +44,7 @@ By default, this will load your site at [http://localhost:3000/](http://localhos
## Trailing slash configuration {#trailing-slashes}
Docusaurus has a [`trailingSlash` config](./api/docusaurus.config.js.md#trailing-slash), to allow customizing URLs/links and emitted filename patterns.
Docusaurus has a [`trailingSlash` config](./api/docusaurus.config.js.md#trailingSlash), to allow customizing URLs/links and emitted filename patterns.
The default value generally works fine. Unfortunately, each static hosting provider has a **different behavior**, and deploying the exact same site to various hosts can lead to distinct results. Depending on your host, it can be useful to change this config.
@ -56,7 +56,7 @@ Use [slorber/trailing-slash-guide](https://github.com/slorber/trailing-slash-gui
## Using environment variables {#using-environment-variables}
Putting potentially sensitive information in the environment is common practice. However, in a typical Docusaurus website, the `docusaurus.config.js` file is the only interface to the Node.js environment (see [our architecture overview](advanced/architecture.md)), while everything else—MDX pages, React components... are client side and do not have direct access to the `process` global. In this case, you can consider using [`customFields`](api/docusaurus.config.js.md#customfields) to pass environment variables to the client side.
Putting potentially sensitive information in the environment is common practice. However, in a typical Docusaurus website, the `docusaurus.config.js` file is the only interface to the Node.js environment (see [our architecture overview](advanced/architecture.md)), while everything else—MDX pages, React components... are client side and do not have direct access to the `process` global. In this case, you can consider using [`customFields`](api/docusaurus.config.js.md#customFields) to pass environment variables to the client side.
```js title="docusaurus.config.js"
// If you are using dotenv (https://www.npmjs.com/package/dotenv)

View file

@ -341,31 +341,31 @@ type PluginVersionInformation =
| {readonly type: 'local'}
| {readonly type: 'synthetic'};
interface DocusaurusSiteMetadata {
type SiteMetadata = {
readonly docusaurusVersion: string;
readonly siteVersion?: string;
readonly pluginVersions: Record<string, PluginVersionInformation>;
}
};
interface I18nLocaleConfig {
type I18nLocaleConfig = {
label: string;
direction: string;
}
};
interface I18n {
type I18n = {
defaultLocale: string;
locales: [string, ...string[]];
currentLocale: string;
localeConfigs: Record<string, I18nLocaleConfig>;
}
};
interface DocusaurusContext {
type DocusaurusContext = {
siteConfig: DocusaurusConfig;
siteMetadata: DocusaurusSiteMetadata;
siteMetadata: SiteMetadata;
globalData: Record<string, unknown>;
i18n: I18n;
codeTranslations: Record<string, string>;
}
};
```
Usage example:
@ -544,7 +544,11 @@ This is the most convenient hook to access plugin global data and should be used
`pluginId` is optional if you don't use multi-instance plugins.
```ts
function usePluginData(pluginName: string, pluginId?: string);
function usePluginData(
pluginName: string,
pluginId?: string,
options?: {failfast?: boolean},
);
```
Usage example:
@ -567,7 +571,10 @@ const MyComponent = () => {
Access global data created by a specific plugin. Given a plugin name, it returns the data of all the plugins instances of that name, by plugin id.
```ts
useAllPluginInstancesData(pluginName: string)
function useAllPluginInstancesData(
pluginName: string,
options?: {failfast?: boolean},
);
```
Usage example:
@ -614,7 +621,7 @@ import {interpolate} from '@docusaurus/Interpolate';
const message = interpolate('Welcome {firstName}', {firstName: 'Sébastien'});
```
### `translate` {#translate-1}
### `translate` {#translate-imperative}
The imperative counterpart of the [`<Translate>`](#translate) component. Also supporting [placeholders interpolation](#interpolate).

View file

@ -7,11 +7,7 @@ sidebar_label: Pages
In this section, we will learn about creating pages in Docusaurus.
This is useful for creating **one-off standalone pages** like a showcase page, playground page, or support page.
The functionality of pages is powered by `@docusaurus/plugin-content-pages`.
You can use React components, or Markdown.
The `@docusaurus/plugin-content-pages` plugin empowers you to create **one-off standalone pages** like a showcase page, playground page, or support page. You can use React components, or Markdown.
:::note
@ -35,9 +31,9 @@ Create a file `/src/pages/helloReact.js`:
import React from 'react';
import Layout from '@theme/Layout';
function Hello() {
export default function Hello() {
return (
<Layout title="Hello">
<Layout title="Hello" description="Hello React Page">
<div
style={{
display: 'flex',
@ -53,8 +49,6 @@ function Hello() {
</Layout>
);
}
export default Hello;
```
Once you save the file, the development server will automatically reload the changes. Now open `http://localhost:3000/helloReact` and you will see the new page you just created.
@ -71,7 +65,7 @@ You can also create TypeScript pages with the `.tsx` extension (`helloReact.tsx`
Create a file `/src/pages/helloMarkdown.md`:
```mdx title="/src/pages/helloMarkdown.md"
```md title="/src/pages/helloMarkdown.md"
---
title: my hello page title
description: my hello page description

View file

@ -37,17 +37,31 @@ id: part1
Lorem ipsum
```
If you want more control over the last part of the document URL, it is possible to add a `slug` (defaults to the `id`).
### Customizing doc URLs {#customizing-doc-urls}
By default, a document's URL location is its file path relative to the `docs` folder. Use the `slug` front matter to change a document's URL.
For example, suppose your site structure looks like this:
```bash
website # Root directory of your site
└── docs
└── guide
└── hello.md
```
By default `hello.md` will be available at `/docs/guide/hello`. You can change its URL location to `/docs/bonjour`:
```md
---
id: part1
slug: part1.html
slug: /bonjour
---
Lorem ipsum
```
`slug` will be appended to the doc plugin's `routeBasePath`, which is `/docs` by default. See [Docs-only mode](#docs-only-mode) for how to remove the `/docs` part from the URL.
:::note
It is possible to use:

View file

@ -307,7 +307,9 @@ function isCategoryIndex({fileName, directories}) {
For handwritten sidebar definitions, you would provide metadata to sidebar items through `sidebars.js`; for autogenerated, Docusaurus would read them from the item's respective file. In addition, you may want to adjust the relative position of each item because, by default, items within a sidebar slice will be generated in **alphabetical order** (using file and folder names).
**For docs**: use additional front matter. The `label`, `className`, and `customProps` attributes are declared in front matter as `sidebar_label`, `sidebar_class_name`, and `sidebar_custom_props`, respectively. Position can be specified in the same way, via `sidebar_position` front matter.
### Doc item metadata {#doc-item-metadata}
The `label`, `className`, and `customProps` attributes are declared in front matter as `sidebar_label`, `sidebar_class_name`, and `sidebar_custom_props`, respectively. Position can be specified in the same way, via `sidebar_position` front matter.
```md title="docs/tutorials/tutorial-easy.md"
---
@ -323,7 +325,9 @@ sidebar_class_name: green
This is the easy tutorial!
```
**For categories**: add a `_category_.json` or `_category_.yml` file in the respective folder. You can specify any category metadata and also the `position` metadata.
### Category item metadata {#category-item-metadata}
Add a `_category_.json` or `_category_.yml` file in the respective folder. You can specify any category metadata and also the `position` metadata. `label`, `className`, `position`, and `customProps` will default to the respective values of the category's linked doc, if there is one.
<Tabs>
<TabItem value="JSON">
@ -338,6 +342,9 @@ This is the easy tutorial!
"link": {
"type": "generated-index",
"title": "Tutorial overview"
},
"customProps": {
"description": "This description can be used in the swizzled DocCard"
}
}
```
@ -354,6 +361,8 @@ className: red
link:
type: generated-index
title: Tutorial overview
customProps:
description: This description can be used in the swizzled DocCard
```
</TabItem>

View file

@ -121,13 +121,17 @@ type SidebarsFile = {
### Hideable sidebar {#hideable-sidebar}
By enabling the `themeConfig.hideableSidebar` option, you can make the entire sidebar hideable, allowing users to better focus on the content. This is especially useful when content is consumed on medium-sized screens (e.g. tablets).
By enabling the `themeConfig.docs.sidebar.hideable` option, you can make the entire sidebar hideable, allowing users to better focus on the content. This is especially useful when content is consumed on medium-sized screens (e.g. tablets).
```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
// highlight-start
hideableSidebar: true,
docs: {
sidebar: {
hideable: true,
},
},
// highlight-end
},
};
@ -135,13 +139,18 @@ module.exports = {
### Auto-collapse sidebar categories {#auto-collapse-sidebar-categories}
The `themeConfig.autoCollapseSidebarCategories` option would collapse all sibling categories when expanding one category. This saves the user from having too many categories open and helps them focus on the selected section.
The `themeConfig.docs.sidebar.autoCollapseCategories` option would collapse all sibling categories when expanding one category. This saves the user from having too many categories open and helps them focus on the selected section.
```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
// highlight-next-line
autoCollapseSidebarCategories: true,
// highlight-start
docs: {
sidebar: {
autoCollapseCategories: true,
},
},
// highlight-end
},
};
```

View file

@ -118,6 +118,8 @@ The pagination label by default is the sidebar label. You can use the front matt
The `ref` type is identical to the [`doc` type](#sidebar-item-doc) in every way, except that it doesn't participate in generating navigation metadata. It only registers itself as a link. When [generating pagination](#generating-pagination) and [displaying sidebar](#sidebar-association), `ref` items are completely ignored.
It is particularly useful where you wish to link to the same document from multiple sidebars. The document only belongs to one sidebar (the one where it's registered as `type: 'doc'` or from an autogenerated directory), but its link will appear in all sidebars that it's registered in.
Consider this example:
```js title="sidebars.js"

View file

@ -87,14 +87,14 @@ If you use [Prettier](https://prettier.io) to format your Markdown files, Pretti
<!-- prettier-ignore -->
```md
<!-- Prettier doesn't change this -->
::: note
:::note
Hello world
:::
<!-- Prettier changes this -->
::: note
:::note
Hello world
:::

View file

@ -6,6 +6,8 @@ slug: /markdown-features/assets
---
import BrowserWindow from '@site/src/components/BrowserWindow';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Sometimes you want to link to assets (e.g. docx files, images...) directly from Markdown files, and it is convenient to co-locate the asset next to the Markdown file using it.
@ -24,12 +26,18 @@ Let's imagine the following file structure:
You can display images in three different ways: Markdown syntax, CJS require, or ES imports syntax.
<Tabs>
<TabItem value="Markdown syntax">
Display images using simple Markdown syntax:
```md
![Example banner](./assets/docusaurus-asset-example-banner.png)
```
</TabItem>
<TabItem value="CommonJS require">
Display images using inline CommonJS `require` in JSX image tag:
```jsx
@ -39,6 +47,9 @@ Display images using inline CommonJS `require` in JSX image tag:
/>
```
</TabItem>
<TabItem value="Import statement">
Display images using ES `import` syntax and JSX image tag:
```jsx
@ -47,7 +58,10 @@ import myImageUrl from './assets/docusaurus-asset-example-banner.png';
<img src={myImageUrl} alt="Example banner" />;
```
This results in displaying the image:
</TabItem>
</Tabs>
All of the above result in displaying the image:
<BrowserWindow>
@ -63,7 +77,7 @@ If you are using [@docusaurus/plugin-ideal-image](../../api/plugins/plugin-ideal
## Files {#files}
In the same way, you can link to existing assets by requiring them and using the returned url in videos, links, etc.
In the same way, you can link to existing assets by `require`'ing them and using the returned URL in `video`s, `a` anchor links, etc.
```md
# My Markdown page
@ -89,7 +103,7 @@ or
:::info markdown links are always file paths
If you use the Markdown image or link syntax, all asset paths will be resolved as file paths by Docusaurus and automatically converted to `require()` calls. You don't need to use `require()` in Markdown unless you use the JSX syntax.
If you use the Markdown image or link syntax, all asset paths will be resolved as file paths by Docusaurus and automatically converted to `require()` calls. You don't need to use `require()` in Markdown unless you use the JSX syntax, which you do have to handle yourself.
:::

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