diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f7332c9d7..a135cd589b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,66 @@ # Docusaurus 2 Changelog +## 2.1.0 (2022-09-01) + +#### :rocket: New Feature + +- `docusaurus-theme-classic`, `docusaurus-theme-common` + - [#8008](https://github.com/facebook/docusaurus/pull/8008) feat(theme): ability to use `` without items prop, on any doc page ([@slorber](https://github.com/slorber)) +- `docusaurus-plugin-content-docs`, `docusaurus-theme-classic` + - [#7963](https://github.com/facebook/docusaurus/pull/7963) feat(docs): allow to configure noIndex per doc version ([@slorber](https://github.com/slorber)) + - [#7949](https://github.com/facebook/docusaurus/pull/7949) feat(plugin-docs): docs sidebar item link: support "autoAddBaseUrl" attribute ([@slorber](https://github.com/slorber)) +- `docusaurus-theme-translations` + - [#7953](https://github.com/facebook/docusaurus/pull/7953) feat(theme): adds Ukrainian default theme translations ([@b-ovsepian](https://github.com/b-ovsepian)) + +#### :bug: Bug Fix + +- `create-docusaurus` + - [#8032](https://github.com/facebook/docusaurus/pull/8032) fix(create-docusaurus): tutorial and init template improvements ([@slorber](https://github.com/slorber)) +- `docusaurus-preset-classic` + - [#8029](https://github.com/facebook/docusaurus/pull/8029) fix(preset-classic): broken link in "unrecognized keys" error message ([@mdubus](https://github.com/mdubus)) +- `docusaurus` + - [#7977](https://github.com/facebook/docusaurus/pull/7977) fix(core): preload should support encoded page links ([@adventure-yunfei](https://github.com/adventure-yunfei)) + - [#7996](https://github.com/facebook/docusaurus/pull/7996) fix(core): CLI command write-translations should extract translations from @docu… ([@slorber](https://github.com/slorber)) + - [#7952](https://github.com/facebook/docusaurus/pull/7952) fix(core): allow overriding ssr/dev template meta tags ([@slorber](https://github.com/slorber)) +- `docusaurus-plugin-sitemap` + - [#7964](https://github.com/facebook/docusaurus/pull/7964) fix(sitemap): filter all routes with robots meta containing noindex ([@slorber](https://github.com/slorber)) +- `docusaurus-theme-classic` + - [#7910](https://github.com/facebook/docusaurus/pull/7910) fix(theme-classic): code block line number display with line wrapping ([@yzhe819](https://github.com/yzhe819)) + - [#7786](https://github.com/facebook/docusaurus/pull/7786) fix: collapse siblings when first category is selected ([@whiteand](https://github.com/whiteand)) + +#### :nail_care: Polish + +- `docusaurus-theme-classic` + - [#7982](https://github.com/facebook/docusaurus/pull/7982) fix(theme): add aria-label to skip to content link region ([@YoniChechik](https://github.com/YoniChechik)) + - [#7940](https://github.com/facebook/docusaurus/pull/7940) refactor(theme-classic): split AnnouncementBar, increase z-index, use shadow ([@slorber](https://github.com/slorber)) + - [#7876](https://github.com/facebook/docusaurus/pull/7876) refactor(theme-classic): make tag text visually certered ([@Kosai106](https://github.com/Kosai106)) +- `docusaurus-utils` + - [#7941](https://github.com/facebook/docusaurus/pull/7941) feat(core): add new Webpack file-loader extensions: avif, mov, mkv, mpg, avi... ([@slorber](https://github.com/slorber)) +- `docusaurus-theme-classic`, `docusaurus-types` + - [#7942](https://github.com/facebook/docusaurus/pull/7942) feat(theme-classic): use lang attribute in navbar locale dropdown items ([@slorber](https://github.com/slorber)) +- `docusaurus-theme-translations` + - [#7928](https://github.com/facebook/docusaurus/pull/7928) chore(theme-translations): complete vi translations ([@datlechin](https://github.com/datlechin)) + +#### :memo: Documentation + +- `create-docusaurus` + - [#8032](https://github.com/facebook/docusaurus/pull/8032) fix(create-docusaurus): tutorial and init template improvements ([@slorber](https://github.com/slorber)) +- `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-debug`, `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-sitemap`, `docusaurus-theme-classic` + - [#7905](https://github.com/facebook/docusaurus/pull/7905) docs: remove mention of beta ([@Josh-Cena](https://github.com/Josh-Cena)) + +#### Committers: 10 + +- Bagdasar Ovsepyan ([@b-ovsepian](https://github.com/b-ovsepian)) +- Joshua Chen ([@Josh-Cena](https://github.com/Josh-Cena)) +- Kevin Østerkilde ([@Kosai106](https://github.com/Kosai106)) +- Morgane Dubus ([@mdubus](https://github.com/mdubus)) +- Ngô Quốc Đạt ([@datlechin](https://github.com/datlechin)) +- Sébastien Lorber ([@slorber](https://github.com/slorber)) +- Yoni Chechik ([@YoniChechik](https://github.com/YoniChechik)) +- [@whiteand](https://github.com/whiteand) +- [@yzhe819](https://github.com/yzhe819) +- adventure-yunfei ([@adventure-yunfei](https://github.com/adventure-yunfei)) + ## 2.0.1 (2022-08-01) Fix bad npm publish of 2.0.0 diff --git a/website/blog/2022-09-01-docusaurus-2.1/img/doc-card-list.png b/website/blog/2022-09-01-docusaurus-2.1/img/doc-card-list.png new file mode 100644 index 0000000000..f8ba6b4408 Binary files /dev/null and b/website/blog/2022-09-01-docusaurus-2.1/img/doc-card-list.png differ diff --git a/website/blog/2022-09-01-docusaurus-2.1/img/social-card.png b/website/blog/2022-09-01-docusaurus-2.1/img/social-card.png new file mode 100644 index 0000000000..88bfbed242 Binary files /dev/null and b/website/blog/2022-09-01-docusaurus-2.1/img/social-card.png differ diff --git a/website/blog/2022-09-01-docusaurus-2.1/index.mdx b/website/blog/2022-09-01-docusaurus-2.1/index.mdx new file mode 100644 index 0000000000..0370649d00 --- /dev/null +++ b/website/blog/2022-09-01-docusaurus-2.1/index.mdx @@ -0,0 +1,85 @@ +--- +title: Docusaurus 2.1 +authors: + - slorber +tags: [release] +image: ./img/social-card.png +--- + +We are happy announce **Docusaurus 2.1**, our very first minor version release. + +The upgrade should be easy: as explained in our [release process documentation](/community/release-process), minor versions respect [Semantic Versioning](https://semver.org/). + +![Docusaurus 2.1 social card](./img/social-card.png) + + + +## Highlights + +### DocCardList improvements + +In [#8008](https://github.com/facebook/docusaurus/pull/8008), we simplified the usage of the`` component, that is notably used on sidebar category generated index pages. + +The `items` prop is now optional, and will be automatically inferred from the content of the parent sidebar category: + +```diff +import DocCardList from '@theme/DocCardList'; +- import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; + +- ++ +``` + +Also, we made it possible to use it on any document, including regular docs not linked to any sidebar category. + +![simplified DocCardList component](./img/doc-card-list.png) + +### `noindex` improvements + +We improved the support of the [`noindex` meta `robots` directive](https://developers.google.com/search/docs/advanced/crawling/block-indexing), a way to signal search engines you don't want a specific page to be indexed. + +In [#7963](https://github.com/facebook/docusaurus/pull/7963), we allow `noindex` to be configured on a per-docs-version basis. + +Use the following plugin options to tell crawlers you don't want the `1.0.0` version to be indexed: + +```jsx +const options = { + versions: { + '1.0.0': { + noIndex: true, + }, + }, +}; +``` + +In practice, Docusaurus will add the following meta to each page of that version: + +```html + +``` + +In [#7964](https://github.com/facebook/docusaurus/pull/7964), we also fixed a bug where the sitemap plugin would still contain pages that have a `noindex` directive. Now the sitemap plugin will reliably filter out all the pages containing `noindex` directives. + +### Overriding default meta tags + +In [#7952](https://github.com/facebook/docusaurus/pull/7952), it becomes possible to override default html meta tags you couldn't before: + +```jsx +<> + {siteConfig.noIndex && } + + +``` + +It is now possible to use `` or `themeConfig.metadata`: + +- to override the `viewport` meta +- to override the `robots` meta: you could mark your site as `noIndex`, but except for specific pages that should be indexed + +### Ukrainian translations + +In [#7953](https://github.com/facebook/docusaurus/pull/7953), we added default classic theme translations for the Ukrainian language. + +## Other changes + +Check the [2.1.0 changelog entry](/changelog/2.1.0) for an exhaustive list of changes. diff --git a/website/versioned_docs/version-2.0.0-rc.1/advanced/architecture.md b/website/versioned_docs/version-2.1.0/advanced/architecture.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/advanced/architecture.md rename to website/versioned_docs/version-2.1.0/advanced/architecture.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/advanced/client.md b/website/versioned_docs/version-2.1.0/advanced/client.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/advanced/client.md rename to website/versioned_docs/version-2.1.0/advanced/client.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/advanced/index.md b/website/versioned_docs/version-2.1.0/advanced/index.md similarity index 81% rename from website/versioned_docs/version-2.0.0-rc.1/advanced/index.md rename to website/versioned_docs/version-2.1.0/advanced/index.md index afe7f1a570..47fc3f8bc9 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/advanced/index.md +++ b/website/versioned_docs/version-2.1.0/advanced/index.md @@ -4,9 +4,8 @@ This section is not going to be very structured, but we will cover the following ```mdx-code-block import DocCardList from '@theme/DocCardList'; -import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; - + ``` We will assume that you have finished the guides, and know the basics like how to configure plugins, how to write React components, etc. These sections will have plugin authors and code contributors in mind, so we may occasionally refer to [plugin APIs](../api/plugin-methods/README.md) or other architecture details. Don't panic if you don't understand everything😉 diff --git a/website/versioned_docs/version-2.0.0-rc.1/advanced/plugins.md b/website/versioned_docs/version-2.1.0/advanced/plugins.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/advanced/plugins.md rename to website/versioned_docs/version-2.1.0/advanced/plugins.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/advanced/routing.md b/website/versioned_docs/version-2.1.0/advanced/routing.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/advanced/routing.md rename to website/versioned_docs/version-2.1.0/advanced/routing.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/advanced/ssg.md b/website/versioned_docs/version-2.1.0/advanced/ssg.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/advanced/ssg.md rename to website/versioned_docs/version-2.1.0/advanced/ssg.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/docusaurus.config.js.md b/website/versioned_docs/version-2.1.0/api/docusaurus.config.js.md similarity index 98% rename from website/versioned_docs/version-2.0.0-rc.1/api/docusaurus.config.js.md rename to website/versioned_docs/version-2.1.0/api/docusaurus.config.js.md index 6aea4f53b1..254bdc0a2d 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/api/docusaurus.config.js.md +++ b/website/versioned_docs/version-2.1.0/api/docusaurus.config.js.md @@ -157,7 +157,7 @@ module.exports = { - `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 Farsi, Arabic, Hebrew, etc.). Used to select the locale's CSS and HTML meta attribute. - - `htmlLang`: BCP 47 language tag to use in `` and in `` + - `htmlLang`: BCP 47 language tag to use in `` (or any other DOM tag name) and in `` - `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`). - `path`: Root folder that all plugin localization folders of this locale are relative to. Will be resolved against `i18n.path`. Defaults to the locale's name. Note: this has no effect on the locale's `baseUrl`—customization of base URL is a work-in-progress. @@ -509,15 +509,11 @@ module.exports = { > - - <% if (it.noIndex) { %> - - <% } %> - <%~ it.headTags %> <% it.metaAttributes.forEach((metaAttribute) => { %> <%~ metaAttribute %> <% }); %> + <%~ it.headTags %> <% it.stylesheets.forEach((stylesheet) => { %> <% }); %> diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/misc/_category_.yml b/website/versioned_docs/version-2.1.0/api/misc/_category_.yml similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/misc/_category_.yml rename to website/versioned_docs/version-2.1.0/api/misc/_category_.yml diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/misc/create-docusaurus.md b/website/versioned_docs/version-2.1.0/api/misc/create-docusaurus.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/misc/create-docusaurus.md rename to website/versioned_docs/version-2.1.0/api/misc/create-docusaurus.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/misc/eslint-plugin/README.md b/website/versioned_docs/version-2.1.0/api/misc/eslint-plugin/README.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/misc/eslint-plugin/README.md rename to website/versioned_docs/version-2.1.0/api/misc/eslint-plugin/README.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/misc/eslint-plugin/no-untranslated-text.md b/website/versioned_docs/version-2.1.0/api/misc/eslint-plugin/no-untranslated-text.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/misc/eslint-plugin/no-untranslated-text.md rename to website/versioned_docs/version-2.1.0/api/misc/eslint-plugin/no-untranslated-text.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/misc/eslint-plugin/string-literal-i18n-messages.md b/website/versioned_docs/version-2.1.0/api/misc/eslint-plugin/string-literal-i18n-messages.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/misc/eslint-plugin/string-literal-i18n-messages.md rename to website/versioned_docs/version-2.1.0/api/misc/eslint-plugin/string-literal-i18n-messages.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/misc/logger/demo.png b/website/versioned_docs/version-2.1.0/api/misc/logger/demo.png similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/misc/logger/demo.png rename to website/versioned_docs/version-2.1.0/api/misc/logger/demo.png diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/misc/logger/logger.md b/website/versioned_docs/version-2.1.0/api/misc/logger/logger.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/misc/logger/logger.md rename to website/versioned_docs/version-2.1.0/api/misc/logger/logger.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/README.md b/website/versioned_docs/version-2.1.0/api/plugin-methods/README.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/README.md rename to website/versioned_docs/version-2.1.0/api/plugin-methods/README.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/_category_.yml b/website/versioned_docs/version-2.1.0/api/plugin-methods/_category_.yml similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/_category_.yml rename to website/versioned_docs/version-2.1.0/api/plugin-methods/_category_.yml diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/extend-infrastructure.md b/website/versioned_docs/version-2.1.0/api/plugin-methods/extend-infrastructure.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/extend-infrastructure.md rename to website/versioned_docs/version-2.1.0/api/plugin-methods/extend-infrastructure.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/i18n-lifecycles.md b/website/versioned_docs/version-2.1.0/api/plugin-methods/i18n-lifecycles.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/i18n-lifecycles.md rename to website/versioned_docs/version-2.1.0/api/plugin-methods/i18n-lifecycles.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/lifecycle-apis.md b/website/versioned_docs/version-2.1.0/api/plugin-methods/lifecycle-apis.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/lifecycle-apis.md rename to website/versioned_docs/version-2.1.0/api/plugin-methods/lifecycle-apis.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/static-methods.md b/website/versioned_docs/version-2.1.0/api/plugin-methods/static-methods.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugin-methods/static-methods.md rename to website/versioned_docs/version-2.1.0/api/plugin-methods/static-methods.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/_category_.yml b/website/versioned_docs/version-2.1.0/api/plugins/_category_.yml similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/_category_.yml rename to website/versioned_docs/version-2.1.0/api/plugins/_category_.yml diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/overview.md b/website/versioned_docs/version-2.1.0/api/plugins/overview.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/overview.md rename to website/versioned_docs/version-2.1.0/api/plugins/overview.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-client-redirects.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-client-redirects.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-client-redirects.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-client-redirects.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-content-blog.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-content-blog.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-content-blog.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-content-blog.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-content-docs.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-content-docs.md similarity index 95% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-content-docs.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-content-docs.md index d645f72673..6e60b02e91 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-content-docs.md +++ b/website/versioned_docs/version-2.1.0/api/plugins/plugin-content-docs.md @@ -142,23 +142,25 @@ type CategoryIndexMatcher = (param: { #### `VersionsConfig` {#VersionsConfig} ```ts -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 element of each doc */ - className?: string; - }; +type VersionConfig = { + /** + * 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; + /** Prevents search engines from indexing this version */ + noIndex?: boolean; + /** Add a custom class name to the element of each doc */ + className?: string; }; + +type VersionsConfig = {[versionName: string]: VersionConfig}; ``` ### Example configuration {#ex-config} diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-content-pages.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-content-pages.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-content-pages.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-content-pages.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-debug.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-debug.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-debug.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-debug.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-google-analytics.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-google-analytics.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-google-analytics.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-google-analytics.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-google-gtag.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-google-gtag.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-google-gtag.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-google-gtag.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-ideal-image.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-ideal-image.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-ideal-image.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-ideal-image.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-pwa.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-pwa.md similarity index 97% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-pwa.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-pwa.md index 71f63febc6..7b96b0ec56 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-pwa.md +++ b/website/versioned_docs/version-2.1.0/api/plugins/plugin-pwa.md @@ -142,7 +142,7 @@ The [`standalone` strategy](https://petelepage.com/blog/2019/07/is-my-pwa-instal ### `injectManifestConfig` {#injectmanifestconfig} -[Workbox options](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.injectManifest) to pass to `workbox.injectManifest()`. This gives you control over which assets will be precached, and be available offline. +[Workbox options](https://developer.chrome.com/docs/workbox/reference/workbox-build/#type-InjectManifestOptions) to pass to `workbox.injectManifest()`. This gives you control over which assets will be precached, and be available offline. - Type: `InjectManifestOptions` - Default: `{}` diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-sitemap.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-sitemap.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/plugins/plugin-sitemap.md rename to website/versioned_docs/version-2.1.0/api/plugins/plugin-sitemap.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/themes/_category_.yml b/website/versioned_docs/version-2.1.0/api/themes/_category_.yml similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/themes/_category_.yml rename to website/versioned_docs/version-2.1.0/api/themes/_category_.yml diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/themes/overview.md b/website/versioned_docs/version-2.1.0/api/themes/overview.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/themes/overview.md rename to website/versioned_docs/version-2.1.0/api/themes/overview.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/themes/theme-classic.md b/website/versioned_docs/version-2.1.0/api/themes/theme-classic.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/themes/theme-classic.md rename to website/versioned_docs/version-2.1.0/api/themes/theme-classic.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/themes/theme-configuration.md b/website/versioned_docs/version-2.1.0/api/themes/theme-configuration.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/themes/theme-configuration.md rename to website/versioned_docs/version-2.1.0/api/themes/theme-configuration.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/themes/theme-live-codeblock.md b/website/versioned_docs/version-2.1.0/api/themes/theme-live-codeblock.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/themes/theme-live-codeblock.md rename to website/versioned_docs/version-2.1.0/api/themes/theme-live-codeblock.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/api/themes/theme-search-algolia.md b/website/versioned_docs/version-2.1.0/api/themes/theme-search-algolia.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/api/themes/theme-search-algolia.md rename to website/versioned_docs/version-2.1.0/api/themes/theme-search-algolia.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/assets/docusaurus-asset-example-banner.png b/website/versioned_docs/version-2.1.0/assets/docusaurus-asset-example-banner.png similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/assets/docusaurus-asset-example-banner.png rename to website/versioned_docs/version-2.1.0/assets/docusaurus-asset-example-banner.png diff --git a/website/versioned_docs/version-2.0.0-rc.1/assets/docusaurus-asset-example.docx b/website/versioned_docs/version-2.1.0/assets/docusaurus-asset-example.docx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/assets/docusaurus-asset-example.docx rename to website/versioned_docs/version-2.1.0/assets/docusaurus-asset-example.docx diff --git a/website/versioned_docs/version-2.0.0-rc.1/assets/docusaurus-asset-example.xyz b/website/versioned_docs/version-2.1.0/assets/docusaurus-asset-example.xyz similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/assets/docusaurus-asset-example.xyz rename to website/versioned_docs/version-2.1.0/assets/docusaurus-asset-example.xyz diff --git a/website/versioned_docs/version-2.0.0-rc.1/blog.mdx b/website/versioned_docs/version-2.1.0/blog.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/blog.mdx rename to website/versioned_docs/version-2.1.0/blog.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/browser-support.md b/website/versioned_docs/version-2.1.0/browser-support.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/browser-support.md rename to website/versioned_docs/version-2.1.0/browser-support.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/cli.md b/website/versioned_docs/version-2.1.0/cli.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/cli.md rename to website/versioned_docs/version-2.1.0/cli.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/configuration.md b/website/versioned_docs/version-2.1.0/configuration.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/configuration.md rename to website/versioned_docs/version-2.1.0/configuration.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/deployment.mdx b/website/versioned_docs/version-2.1.0/deployment.mdx similarity index 99% rename from website/versioned_docs/version-2.0.0-rc.1/deployment.mdx rename to website/versioned_docs/version-2.1.0/deployment.mdx index 642530ea69..d285b6447f 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/deployment.mdx +++ b/website/versioned_docs/version-2.1.0/deployment.mdx @@ -320,14 +320,14 @@ GIT_USER= yarn deploy cmd /C "set "GIT_USER=" && yarn deploy" ``` -````mdx-code-block +```mdx-code-block -```mdx-code-block +``` ```powershell cmd /C 'set "GIT_USER=" && yarn deploy' -```` +``` ```mdx-code-block diff --git a/website/versioned_docs/version-2.0.0-rc.1/docusaurus-core.md b/website/versioned_docs/version-2.1.0/docusaurus-core.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/docusaurus-core.md rename to website/versioned_docs/version-2.1.0/docusaurus-core.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/creating-pages.md b/website/versioned_docs/version-2.1.0/guides/creating-pages.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/creating-pages.md rename to website/versioned_docs/version-2.1.0/guides/creating-pages.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/docs-create-doc.mdx b/website/versioned_docs/version-2.1.0/guides/docs/docs-create-doc.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/docs/docs-create-doc.mdx rename to website/versioned_docs/version-2.1.0/guides/docs/docs-create-doc.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/docs-introduction.md b/website/versioned_docs/version-2.1.0/guides/docs/docs-introduction.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/docs/docs-introduction.md rename to website/versioned_docs/version-2.1.0/guides/docs/docs-introduction.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/docs-multi-instance.mdx b/website/versioned_docs/version-2.1.0/guides/docs/docs-multi-instance.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/docs/docs-multi-instance.mdx rename to website/versioned_docs/version-2.1.0/guides/docs/docs-multi-instance.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/autogenerated.md b/website/versioned_docs/version-2.1.0/guides/docs/sidebar/autogenerated.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/autogenerated.md rename to website/versioned_docs/version-2.1.0/guides/docs/sidebar/autogenerated.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/index.md b/website/versioned_docs/version-2.1.0/guides/docs/sidebar/index.md similarity index 97% rename from website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/index.md rename to website/versioned_docs/version-2.1.0/guides/docs/sidebar/index.md index 06eb5a91b3..8e8817b543 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/index.md +++ b/website/versioned_docs/version-2.1.0/guides/docs/sidebar/index.md @@ -35,9 +35,8 @@ This section serves as an overview of miscellaneous features of the doc sidebar. ```mdx-code-block import DocCardList from '@theme/DocCardList'; -import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; - + ``` ## Default sidebar {#default-sidebar} diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/items.md b/website/versioned_docs/version-2.1.0/guides/docs/sidebar/items.md similarity index 96% rename from website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/items.md rename to website/versioned_docs/version-2.1.0/guides/docs/sidebar/items.md index fa7af72ca9..1e5d8ffdf9 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/items.md +++ b/website/versioned_docs/version-2.1.0/guides/docs/sidebar/items.md @@ -8,6 +8,7 @@ slug: /sidebar/items ```mdx-code-block import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +import BrowserWindow from '@site/src/components/BrowserWindow'; ``` We have introduced three types of item types in the example in the previous section: `doc`, `category`, and `link`, whose usages are fairly intuitive. We will formally introduce their APIs. There's also a fourth type: `autogenerated`, which we will explain in detail later. @@ -291,18 +292,23 @@ See it in action on the [i18n introduction page](../../../i18n/i18n-introduction #### Embedding generated index in doc page {#embedding-generated-index-in-doc-page} -You can embed the generated cards list in a normal doc page as well, as long as the doc is used as a category index page. To do so, you need to use the `DocCardList` component, paired with the `useCurrentSidebarCategory` hook. +You can embed the generated cards list in a normal doc page as well with the `DocCardList` component. It will display all the sidebar items of the parent category of the current document. -```jsx title="a-category-index-page.md" +```md title="docs/sidebar/index.md" import DocCardList from '@theme/DocCardList'; -import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; -In this section, we will introduce the following concepts: - - + ``` -See this in action on the [sidebar guides page](index.md). +```mdx-code-block + + +import DocCardList from '@theme/DocCardList'; + + + + +``` ### Collapsible categories {#collapsible-categories} diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/multiple-sidebars.md b/website/versioned_docs/version-2.1.0/guides/docs/sidebar/multiple-sidebars.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/docs/sidebar/multiple-sidebars.md rename to website/versioned_docs/version-2.1.0/guides/docs/sidebar/multiple-sidebars.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/docs/versioning.md b/website/versioned_docs/version-2.1.0/guides/docs/versioning.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/docs/versioning.md rename to website/versioned_docs/version-2.1.0/guides/docs/versioning.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/_markdown-partial-example.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/_markdown-partial-example.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/_markdown-partial-example.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/_markdown-partial-example.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx similarity index 62% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-admonitions.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx index 719dd371c9..94f7cb7b61 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -11,7 +11,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import Admonition from '@theme/Admonition'; -In addition to the basic Markdown syntax, we use [remark-admonitions](https://github.com/elviswolcott/remark-admonitions) alongside MDX to add support for admonitions. Admonitions are wrapped by a set of 3 colons. +In addition to the basic Markdown syntax, we have a special admonitions syntax by wrapping text with a set of 3 colons, followed by a label denoting its type. Example: @@ -107,7 +107,7 @@ Hello world ## Specifying title {#specifying-title} -You may also specify an optional title +You may also specify an optional title. ```md :::note Your Title @@ -204,3 +204,53 @@ The types that are accepted are the same as above: `note`, `tip`, `danger`, `inf ``` + +## Customizing admonitions {#customizing-admonitions} + +There are two kinds of customizations possible with admonitions: **parsing** and **rendering**. + +### Customizing rendering behavior {#customizing-rendering-behavior} + +You can customize how each individual admonition type is rendered through [swizzling](../../swizzling.md). You can often achieve your goal through a simple wrapper. For example, in the follow example, we swap out the icon for `info` admonitions only. + +```jsx title="src/theme/Admonition.js" +import React from 'react'; +import Admonition from '@theme-original/Admonition'; +import MyIcon from '@site/static/img/info.svg'; + +export default function AdmonitionWrapper(props) { + if (props.type !== 'info') { + return ; + } + return } {...props} />; +} +``` + +### Customizing parsing behavior {#customizing-parsing-behavior} + +Admonitions are implemented with a [Remark plugin](./markdown-features-plugins.mdx). The plugin is designed to be configurable. To customize the Remark plugin for a specific content plugin (docs, blog, pages), pass the options through the `admonitions` key. + +```js title="docusaurus.config.js" +module.exports = { + presets: [ + [ + '@docusaurus/preset-classic', + { + docs: { + admonitions: { + tag: ':::', + keywords: ['note', 'tip', 'info', 'caution', 'danger'], + }, + }, + }, + ], + ], +}; +``` + +The plugin accepts two options: + +- `tag`: The tag that encloses the admonition. Defaults to `:::`. +- `keywords`: An array of keywords that can be used as the type for the admonition. Note that if you override this, the default values will not be applied. + +The `keyword` will be passed as the `type` prop of the `Admonition` component. If you register more types than the default, you are also responsible for providing their implementation—including the container's style, icon, default title text, etc. You would usually need to [eject](../../swizzling.md#ejecting) the `@theme/Admonition` component, so you could re-use the same infrastructure as the other types. diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-assets.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-assets.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-assets.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-assets.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-code-blocks.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-code-blocks.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-code-blocks.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-code-blocks.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-head-metadata.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-head-metadata.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-head-metadata.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-head-metadata.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-intro.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-intro.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-intro.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-intro.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-links.md b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-links.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-links.md rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-links.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-math-equations.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-math-equations.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-math-equations.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-math-equations.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-plugins.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-plugins.mdx similarity index 98% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-plugins.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-plugins.mdx index 6a7a3629c1..50e6d37a6d 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-plugins.mdx +++ b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-plugins.mdx @@ -25,7 +25,7 @@ If you play with the [MDX playground](https://mdx-git-renovate-babel-monorepo-md :::tip -Use plugins to introduce shorter syntax for the most commonly used JSX elements in your project. The [admonition](./markdown-features-admonitions.mdx) syntax that we offer is also generated by a [Remark plugin](https://github.com/elviswolcott/remark-admonitions), and you could do the same for your own use case. +Use plugins to introduce shorter syntax for the most commonly used JSX elements in your project. The [admonition](./markdown-features-admonitions.mdx) syntax that we offer is also generated by a Remark plugin, and you could do the same for your own use case. ::: diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-react.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-react.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-react.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-react.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-react.module.css b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-react.module.css similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-react.module.css rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-react.module.css diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-tabs-styles.module.css b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-tabs-styles.module.css similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-tabs-styles.module.css rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-tabs-styles.module.css diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-tabs.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-tabs.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-tabs.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-tabs.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/markdown-features/markdown-features-toc.mdx rename to website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/guides/whats-next.md b/website/versioned_docs/version-2.1.0/guides/whats-next.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/guides/whats-next.md rename to website/versioned_docs/version-2.1.0/guides/whats-next.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/i18n/i18n-crowdin.mdx b/website/versioned_docs/version-2.1.0/i18n/i18n-crowdin.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/i18n/i18n-crowdin.mdx rename to website/versioned_docs/version-2.1.0/i18n/i18n-crowdin.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/i18n/i18n-git.md b/website/versioned_docs/version-2.1.0/i18n/i18n-git.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/i18n/i18n-git.md rename to website/versioned_docs/version-2.1.0/i18n/i18n-git.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/i18n/i18n-introduction.md b/website/versioned_docs/version-2.1.0/i18n/i18n-introduction.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/i18n/i18n-introduction.md rename to website/versioned_docs/version-2.1.0/i18n/i18n-introduction.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/i18n/i18n-tutorial.md b/website/versioned_docs/version-2.1.0/i18n/i18n-tutorial.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/i18n/i18n-tutorial.md rename to website/versioned_docs/version-2.1.0/i18n/i18n-tutorial.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/installation.md b/website/versioned_docs/version-2.1.0/installation.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/installation.md rename to website/versioned_docs/version-2.1.0/installation.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/introduction.md b/website/versioned_docs/version-2.1.0/introduction.md similarity index 94% rename from website/versioned_docs/version-2.0.0-rc.1/introduction.md rename to website/versioned_docs/version-2.1.0/introduction.md index 894f88e826..c8a0768c46 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/introduction.md +++ b/website/versioned_docs/version-2.1.0/introduction.md @@ -65,11 +65,9 @@ import LiteYouTubeEmbed from 'react-lite-youtube-embed'; ``` -## Disclaimer {#disclaimer} +## Migrating from v1 {#migrating-from-v1} -Docusaurus v2 is **beta** but already quite stable and widely used. - -We highly encourage you to **use Docusaurus v2 over Docusaurus v1**, as Docusaurus v1 will be deprecated soon. +Docusaurus v2 has been a total rewrite from Docusaurus v1, taking advantage of a completely modernized toolchain. After [v2's official release](https://docusaurus.io/blog/2022/08/01/announcing-docusaurus-2.0), we highly encourage you to **use Docusaurus v2 over Docusaurus v1**, as Docusaurus v1 has been deprecated. A [lot of users](/showcase) are already using Docusaurus v2 ([trends](https://www.npmtrends.com/docusaurus-vs-@docusaurus/core)). @@ -83,7 +81,9 @@ A [lot of users](/showcase) are already using Docusaurus v2 ([trends](https://ww **Use [Docusaurus v1](https://v1.docusaurus.io/) if:** - :x: You don't want a single-page application (SPA) -- :x: You need support for IE11 +- :x: You need support for IE11 (...do you? IE [has already reached end-of-life](https://docs.microsoft.com/en-us/lifecycle/products/internet-explorer-11) and is no longer officially supported) + +For existing v1 users that are seeking to upgrade to v2, you can follow our [migration guide](./migration/migration-overview.md). ## Features {#features} diff --git a/website/versioned_docs/version-2.0.0-rc.1/migration/migration-automated.md b/website/versioned_docs/version-2.1.0/migration/migration-automated.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/migration/migration-automated.md rename to website/versioned_docs/version-2.1.0/migration/migration-automated.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/migration/migration-manual.md b/website/versioned_docs/version-2.1.0/migration/migration-manual.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/migration/migration-manual.md rename to website/versioned_docs/version-2.1.0/migration/migration-manual.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/migration/migration-overview.md b/website/versioned_docs/version-2.1.0/migration/migration-overview.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/migration/migration-overview.md rename to website/versioned_docs/version-2.1.0/migration/migration-overview.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/migration/migration-translated-sites.md b/website/versioned_docs/version-2.1.0/migration/migration-translated-sites.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/migration/migration-translated-sites.md rename to website/versioned_docs/version-2.1.0/migration/migration-translated-sites.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/migration/migration-versioned-sites.md b/website/versioned_docs/version-2.1.0/migration/migration-versioned-sites.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/migration/migration-versioned-sites.md rename to website/versioned_docs/version-2.1.0/migration/migration-versioned-sites.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/playground.mdx b/website/versioned_docs/version-2.1.0/playground.mdx similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/playground.mdx rename to website/versioned_docs/version-2.1.0/playground.mdx diff --git a/website/versioned_docs/version-2.0.0-rc.1/search.md b/website/versioned_docs/version-2.1.0/search.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/search.md rename to website/versioned_docs/version-2.1.0/search.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/seo.md b/website/versioned_docs/version-2.1.0/seo.md similarity index 85% rename from website/versioned_docs/version-2.0.0-rc.1/seo.md rename to website/versioned_docs/version-2.1.0/seo.md index 578bb7761c..f252889cdf 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/seo.md +++ b/website/versioned_docs/version-2.1.0/seo.md @@ -124,7 +124,11 @@ Read more about the robots file in [the Google documentation](https://developers :::caution -**Important**: the `robots.txt` file does **not** prevent HTML pages from being indexed. Use `` as [page metadata](#single-page-metadata) to prevent it from appearing in search results entirely. +**Important**: the `robots.txt` file does **not** prevent HTML pages from being indexed. + +To prevent your whole Docusaurus site from being indexed, use the [`noIndex`](./api/docusaurus.config.js.md#noIndex) site config. Some [hosting providers](./deployment.mdx) may also let you configure a `X-Robots-Tag: noindex` HTTP header (GitHub Pages does not support this). + +To prevent a single page from being indexed, use `` as [page metadata](#single-page-metadata). Read more about the [robots meta tag](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag). ::: @@ -132,6 +136,20 @@ Read more about the robots file in [the Google documentation](https://developers Docusaurus provides the [`@docusaurus/plugin-sitemap`](./api/plugins/plugin-sitemap.md) plugin, which is shipped with `preset-classic` by default. It autogenerates a `sitemap.xml` file which will be available at `https://example.com/[baseUrl]/sitemap.xml` after the production build. This sitemap metadata helps search engine crawlers crawl your site more accurately. +:::tip + +The sitemap plugin automatically filters pages containing a `noindex` [robots meta directive](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag). + +For example, [`/examples/noIndex`](/examples/noIndex) is not included in the [Docusaurus sitemap.xml file](pathname:///sitemap.xml) because it contains the following [page metadata](#single-page-metadata): + +```html + + + +``` + +::: + ## Human readable links {#human-readable-links} Docusaurus uses your file names as links, but you can always change that using slugs, see this [tutorial](./guides/docs/docs-introduction.md#document-id) for more details. diff --git a/website/versioned_docs/version-2.0.0-rc.1/static-assets.md b/website/versioned_docs/version-2.1.0/static-assets.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/static-assets.md rename to website/versioned_docs/version-2.1.0/static-assets.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/styling-layout.md b/website/versioned_docs/version-2.1.0/styling-layout.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/styling-layout.md rename to website/versioned_docs/version-2.1.0/styling-layout.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/swizzling.md b/website/versioned_docs/version-2.1.0/swizzling.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/swizzling.md rename to website/versioned_docs/version-2.1.0/swizzling.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/typescript-support.md b/website/versioned_docs/version-2.1.0/typescript-support.md similarity index 100% rename from website/versioned_docs/version-2.0.0-rc.1/typescript-support.md rename to website/versioned_docs/version-2.1.0/typescript-support.md diff --git a/website/versioned_docs/version-2.0.0-rc.1/using-plugins.md b/website/versioned_docs/version-2.1.0/using-plugins.md similarity index 94% rename from website/versioned_docs/version-2.0.0-rc.1/using-plugins.md rename to website/versioned_docs/version-2.1.0/using-plugins.md index e6f83f13e1..1994fe7e80 100644 --- a/website/versioned_docs/version-2.0.0-rc.1/using-plugins.md +++ b/website/versioned_docs/version-2.1.0/using-plugins.md @@ -180,26 +180,6 @@ module.exports = { }; ``` -In addition to these plugins and themes, `@docusaurus/theme-classic` adds [`remark-admonitions`](https://github.com/elviswolcott/remark-admonitions) as a remark plugin to `@docusaurus/plugin-content-blog` and `@docusaurus/plugin-content-docs`. - -The `admonitions` key will be passed as the [options](https://github.com/elviswolcott/remark-admonitions#options) to `remark-admonitions`. Passing `false` will prevent the plugin from being added to MDX. - -```js title="docusaurus.config.js" -module.exports = { - presets: [ - [ - '@docusaurus/preset-classic', - { - docs: { - // options for remark-admonitions - admonitions: {}, - }, - }, - ], - ], -}; -``` - ### Installing presets {#installing-presets} A preset is usually an npm package, so you install them like other npm packages using npm. diff --git a/website/versioned_sidebars/version-2.0.0-rc.1-sidebars.json b/website/versioned_sidebars/version-2.1.0-sidebars.json similarity index 100% rename from website/versioned_sidebars/version-2.0.0-rc.1-sidebars.json rename to website/versioned_sidebars/version-2.1.0-sidebars.json diff --git a/website/versions.json b/website/versions.json index d8b54c7b76..151d85167b 100644 --- a/website/versions.json +++ b/website/versions.json @@ -1,4 +1,4 @@ [ - "2.0.1", - "2.0.0-rc.1" + "2.1.0", + "2.0.1" ] diff --git a/website/versionsArchived.json b/website/versionsArchived.json index c01e206df8..9d2a7ec920 100644 --- a/website/versionsArchived.json +++ b/website/versionsArchived.json @@ -1,4 +1,5 @@ { + "2.0.0-rc.1": "https://6310933e91a4590008bcd3ee--docusaurus-2.netlify.app/docs/2.0.0-rc.1", "2.0.0-beta.22": "https://62e6a82f2c09f60009c53522--docusaurus-2.netlify.app/docs/2.0.0-beta.22", "2.0.0-beta.21": "https://62d02ff810c1170009a4fa0c--docusaurus-2.netlify.app/docs/2.0.0-beta.21", "2.0.0-beta.20": "https://62c814ff3641af00082fe735--docusaurus-2.netlify.app/docs/2.0.0-beta.20",