mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
chore(v2): prepare v2.0.0-beta.10 release (#6076)
This commit is contained in:
parent
fd966b5395
commit
43ac7d5da9
113 changed files with 2220 additions and 1287 deletions
241
CHANGELOG.md
241
CHANGELOG.md
|
@ -1,5 +1,246 @@
|
|||
# Docusaurus 2 Changelog
|
||||
|
||||
## 2.0.0-beta.10 (2021-12-09)
|
||||
|
||||
#### :rocket: New Feature
|
||||
|
||||
- `create-docusaurus`, `docusaurus-types`, `docusaurus`
|
||||
- [#5930](https://github.com/facebook/docusaurus/pull/5930) feat: shorthands for themes/plugins/presets configuration ([@fsmaia](https://github.com/fsmaia))
|
||||
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-translations`, `docusaurus-utils`, `docusaurus`
|
||||
- [#5830](https://github.com/facebook/docusaurus/pull/5830) feat(content-docs): sidebar category linking to document or auto-generated index page ([@slorber](https://github.com/slorber))
|
||||
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-remark-plugin-npm2yarn`, `docusaurus-types`, `docusaurus`
|
||||
- [#4095](https://github.com/facebook/docusaurus/pull/4095) feat(core): allow sourcing from multiple static directories ([@oriooctopus](https://github.com/oriooctopus))
|
||||
- `create-docusaurus`
|
||||
- [#3458](https://github.com/facebook/docusaurus/pull/3458) feat(create-docusaurus): allow using local folder as template ([@afshinm](https://github.com/afshinm))
|
||||
- `docusaurus-plugin-content-blog`
|
||||
- [#5787](https://github.com/facebook/docusaurus/pull/5787) feat(content-blog): allow sorting posts in ascending order ([@cerkiewny](https://github.com/cerkiewny))
|
||||
- `docusaurus-module-type-aliases`, `docusaurus-theme-classic`, `docusaurus`
|
||||
- [#3104](https://github.com/facebook/docusaurus/pull/3104) feat(core): Add React ErrorBoundary component + theme default boundaries ([@spyke01](https://github.com/spyke01))
|
||||
|
||||
#### :boom: Breaking Change
|
||||
|
||||
- `docusaurus-plugin-content-blog`
|
||||
- [#6061](https://github.com/facebook/docusaurus/pull/6061) fix(content-blog): make post ID unique ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-migrate`, `docusaurus-plugin-content-docs`
|
||||
- [#6065](https://github.com/facebook/docusaurus/pull/6065) refactor: remove deprecated docs homePageId option ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-plugin-content-docs`
|
||||
- [#6056](https://github.com/facebook/docusaurus/pull/6056) refactor: remove unused metadata field for homepage ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-translations`, `docusaurus-utils`, `docusaurus`
|
||||
- [#5830](https://github.com/facebook/docusaurus/pull/5830) feat(content-docs): sidebar category linking to document or auto-generated index page ([@slorber](https://github.com/slorber))
|
||||
- `docusaurus-module-type-aliases`, `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-preset-classic`
|
||||
- [#5832](https://github.com/facebook/docusaurus/pull/5832) refactor(ganalytics, gtag): move options out of themeConfig ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `create-docusaurus`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-search-algolia`, `docusaurus-utils`
|
||||
- [#5871](https://github.com/facebook/docusaurus/pull/5871) misc: replace all "Metadatas" with "Metadata" ([@swalahamani](https://github.com/swalahamani))
|
||||
|
||||
#### :bug: Bug Fix
|
||||
|
||||
- `docusaurus-theme-common`
|
||||
- [#6070](https://github.com/facebook/docusaurus/pull/6070) fix(theme-common): useLocationChange fire un-necessarily twice ([@slorber](https://github.com/slorber))
|
||||
- [#6040](https://github.com/facebook/docusaurus/pull/6040) fix: browser storage (localStorage) is unreliable: api should fail-safe ([@slorber](https://github.com/slorber))
|
||||
- `create-docusaurus`, `docusaurus-mdx-loader`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-debug`, `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-pwa`, `docusaurus-plugin-sitemap`, `docusaurus-preset-classic`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-theme-search-algolia`, `docusaurus-theme-translations`, `docusaurus-utils-validation`, `docusaurus-utils`, `docusaurus`
|
||||
- [#6047](https://github.com/facebook/docusaurus/pull/6047) fix: make Docusaurus PnP strict mode compatible ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-theme-classic`, `docusaurus`
|
||||
- [#6052](https://github.com/facebook/docusaurus/pull/6052) fix(core): fix error boundary import disrupting CSS order ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-plugin-content-blog`
|
||||
- [#6061](https://github.com/facebook/docusaurus/pull/6061) fix(content-blog): make post ID unique ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus`
|
||||
- [#5983](https://github.com/facebook/docusaurus/pull/5983) fix(core): do not apply theme-init alias to user component ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5798](https://github.com/facebook/docusaurus/pull/5798) fix(cli): update notifier should be shown if current is less than latest ([@semoal](https://github.com/semoal))
|
||||
- [#5864](https://github.com/facebook/docusaurus/pull/5864) fix: respect base URL when serving content by webpack dev server ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-module-type-aliases`
|
||||
- [#5945](https://github.com/facebook/docusaurus/pull/5945) fix(module-type-aliases): add svg declaration ([@MisterFISHUP](https://github.com/MisterFISHUP))
|
||||
- `docusaurus-theme-classic`
|
||||
- [#5873](https://github.com/facebook/docusaurus/pull/5873) fix(theme-classic): fix announcementBar css ([@slorber](https://github.com/slorber))
|
||||
|
||||
#### :nail_care: Polish
|
||||
|
||||
- `docusaurus-theme-classic`
|
||||
- [#6003](https://github.com/facebook/docusaurus/pull/6003) fix(theme-classic): make nav dropdowns focusable ([@robinmetral](https://github.com/robinmetral))
|
||||
- [#6000](https://github.com/facebook/docusaurus/pull/6000) fix(theme-classic): make hash link in heading not selectable ([@JararvisQ](https://github.com/JararvisQ))
|
||||
- [#5944](https://github.com/facebook/docusaurus/pull/5944) fix: translate all remaining english sentence in French ([@StanKocken](https://github.com/StanKocken))
|
||||
- `docusaurus-theme-classic`, `docusaurus`
|
||||
- [#6048](https://github.com/facebook/docusaurus/pull/6048) refactor: capitalize locales when creating i18n config ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-theme-translations`
|
||||
- [#5976](https://github.com/facebook/docusaurus/pull/5976) feat(theme-translations): add extra Korean translation, fix typo ([@revi](https://github.com/revi))
|
||||
- [#6060](https://github.com/facebook/docusaurus/pull/6060) chore(theme-translations): complete Chinese translations ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-migrate`, `docusaurus-plugin-content-docs`
|
||||
- [#6065](https://github.com/facebook/docusaurus/pull/6065) refactor: remove deprecated docs homePageId option ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-plugin-content-docs`
|
||||
- [#6056](https://github.com/facebook/docusaurus/pull/6056) refactor: remove unused metadata field for homepage ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-theme-classic`, `docusaurus-theme-common`
|
||||
- [#6049](https://github.com/facebook/docusaurus/pull/6049) refactor: simplify Toggle component ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-theme-classic`, `docusaurus-theme-search-algolia`, `docusaurus-theme-translations`, `docusaurus-types`
|
||||
- [#5981](https://github.com/facebook/docusaurus/pull/5981) refactor: minor ESLint improvements ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-plugin-pwa`
|
||||
- [#5995](https://github.com/facebook/docusaurus/pull/5995) chore(plugin-pwa): change core-js version in package.json to v3 ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-plugin-pwa`, `docusaurus-theme-classic`, `docusaurus-theme-live-codeblock`, `docusaurus-theme-search-algolia`, `docusaurus-theme-translations`, `docusaurus-utils`
|
||||
- [#5849](https://github.com/facebook/docusaurus/pull/5849) refactor: define own translations in other themes ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-types`
|
||||
- [#5959](https://github.com/facebook/docusaurus/pull/5959) refactor(types): correct HtmlTags types ([@armano2](https://github.com/armano2))
|
||||
- `docusaurus`
|
||||
- [#5829](https://github.com/facebook/docusaurus/pull/5829) refactor: optimize clone and checkout in deploy command ([@sivapalan](https://github.com/sivapalan))
|
||||
- [#5899](https://github.com/facebook/docusaurus/pull/5899) feat(core): give more hints when plugins have duplicate IDs ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-module-type-aliases`, `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-preset-classic`
|
||||
- [#5832](https://github.com/facebook/docusaurus/pull/5832) refactor(ganalytics, gtag): move options out of themeConfig ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `create-docusaurus`, `docusaurus`
|
||||
- [#5840](https://github.com/facebook/docusaurus/pull/5840) feat: allow GIT_USER env var to be unset if SSH is used ([@wpyoga](https://github.com/wpyoga))
|
||||
- `create-docusaurus`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-search-algolia`, `docusaurus-utils`
|
||||
- [#5871](https://github.com/facebook/docusaurus/pull/5871) misc: replace all "Metadatas" with "Metadata" ([@swalahamani](https://github.com/swalahamani))
|
||||
|
||||
#### :memo: Documentation
|
||||
|
||||
- Other
|
||||
- [#6063](https://github.com/facebook/docusaurus/pull/6063) docs: add moja global to showcase ([@sohamsshah](https://github.com/sohamsshah))
|
||||
- [#6069](https://github.com/facebook/docusaurus/pull/6069) docs: update CONTRIBUTING for website ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#6062](https://github.com/facebook/docusaurus/pull/6062) refactor(website): improve wording in comments of showcase data ([@sohamsshah](https://github.com/sohamsshah))
|
||||
- [#6045](https://github.com/facebook/docusaurus/pull/6045) docs: add "discord resources" to showcase ([@dexbiobot](https://github.com/dexbiobot))
|
||||
- [#6026](https://github.com/facebook/docusaurus/pull/6026) docs(deployment): add cost-benefit analysis with different options ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5955](https://github.com/facebook/docusaurus/pull/5955) docs: add Pearl UI website to showcase ([@agrawal-rohit](https://github.com/agrawal-rohit))
|
||||
- [#5989](https://github.com/facebook/docusaurus/pull/5989) misc: update CONTRIBUTING to reflect status quo ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5845](https://github.com/facebook/docusaurus/pull/5845) docs(admin): update repo testing instructions to reflect v2 ([@wpyoga](https://github.com/wpyoga))
|
||||
- [#6019](https://github.com/facebook/docusaurus/pull/6019) docs: update Netlify url config option in deployment instructions ([@rsapkf](https://github.com/rsapkf))
|
||||
- [#6015](https://github.com/facebook/docusaurus/pull/6015) docs: add Tremor website to showcase page ([@skoech](https://github.com/skoech))
|
||||
- [#5997](https://github.com/facebook/docusaurus/pull/5997) refactor(website): various fixes and improvements on Showcase page ([@lex111](https://github.com/lex111))
|
||||
- [#6008](https://github.com/facebook/docusaurus/pull/6008) docs: improve algolia integration instructions ([@shafy](https://github.com/shafy))
|
||||
- [#6006](https://github.com/facebook/docusaurus/pull/6006) docs: improve explanation for url config in GH Pages ([@Martinsos](https://github.com/Martinsos))
|
||||
- [#6001](https://github.com/facebook/docusaurus/pull/6001) docs: add Dime.Scheduler SDK to showcase ([@hbulens](https://github.com/hbulens))
|
||||
- [#5984](https://github.com/facebook/docusaurus/pull/5984) docs: add PREFS website to showcase ([@Patitotective](https://github.com/Patitotective))
|
||||
- [#5967](https://github.com/facebook/docusaurus/pull/5967) docs(website): Add docsearch migration blog post ([@slorber](https://github.com/slorber))
|
||||
- [#5968](https://github.com/facebook/docusaurus/pull/5968) refactor(website): shadow on showcase toggle ([@dsmmcken](https://github.com/dsmmcken))
|
||||
- [#5979](https://github.com/facebook/docusaurus/pull/5979) docs: update links to default translations dir ([@lex111](https://github.com/lex111))
|
||||
- [#5969](https://github.com/facebook/docusaurus/pull/5969) refactor(website): polish on Showcase page ([@slorber](https://github.com/slorber))
|
||||
- [#5966](https://github.com/facebook/docusaurus/pull/5966) docs: add Darklang to showcase ([@pbiggar](https://github.com/pbiggar))
|
||||
- [#5970](https://github.com/facebook/docusaurus/pull/5970) docs: add Remirror to showcase ([@ronnyroeller](https://github.com/ronnyroeller))
|
||||
- [#5971](https://github.com/facebook/docusaurus/pull/5971) docs: add Webiny docs to showcase page ([@swapnilmmane](https://github.com/swapnilmmane))
|
||||
- [#5953](https://github.com/facebook/docusaurus/pull/5953) docs: fix BrowserOnly return statement ([@MorookaKotaro](https://github.com/MorookaKotaro))
|
||||
- [#5949](https://github.com/facebook/docusaurus/pull/5949) docs: update Signoz showcase details ([@pal-sig](https://github.com/pal-sig))
|
||||
- [#5948](https://github.com/facebook/docusaurus/pull/5948) fix(website): fix APITable anchor ID having extra hash ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5947](https://github.com/facebook/docusaurus/pull/5947) fix(website): fix APITable anchor link ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5925](https://github.com/facebook/docusaurus/pull/5925) docs: add Froggit site to showcase page ([@cchaudier](https://github.com/cchaudier))
|
||||
- [#5928](https://github.com/facebook/docusaurus/pull/5928) docs: Add Shotstack showcase user ([@jeffski](https://github.com/jeffski))
|
||||
- [#5934](https://github.com/facebook/docusaurus/pull/5934) docs: fix a typo in CHANGELOG ([@KonstHardy](https://github.com/KonstHardy))
|
||||
- [#5921](https://github.com/facebook/docusaurus/pull/5921) docs: add Signoz site to showcase site ([@pal-sig](https://github.com/pal-sig))
|
||||
- [#5891](https://github.com/facebook/docusaurus/pull/5891) docs: new APITable comp to render large tables ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5917](https://github.com/facebook/docusaurus/pull/5917) docs: make API sidebar partially autogenerated ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5903](https://github.com/facebook/docusaurus/pull/5903) docs: refer to deployed branch as deployment rather than target ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5902](https://github.com/facebook/docusaurus/pull/5902) fix(website): fix i18n routes for Canny board ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5900](https://github.com/facebook/docusaurus/pull/5900) docs: document global variables in MDX scope ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#4409](https://github.com/facebook/docusaurus/pull/4409) docs: add example for Github Pages deployment; rewrite deployment section ([@polarathene](https://github.com/polarathene))
|
||||
- [#5888](https://github.com/facebook/docusaurus/pull/5888) docs: update GitHub deployment instructions ([@rootwork](https://github.com/rootwork))
|
||||
- [#5895](https://github.com/facebook/docusaurus/pull/5895) docs: Add juffalow.com to Docusaurus showcase ([@juffalow](https://github.com/juffalow))
|
||||
- [#5881](https://github.com/facebook/docusaurus/pull/5881) docs: fix wrong code sample in docusaurus-core ([@matthijsgroen](https://github.com/matthijsgroen))
|
||||
- [#5875](https://github.com/facebook/docusaurus/pull/5875) docs: add patrikmasiar website showcase ([@patrikmasiar](https://github.com/patrikmasiar))
|
||||
- [#5876](https://github.com/facebook/docusaurus/pull/5876) docs: '5 minutes tutorial' -> '5-minute tutorial' ([@molly](https://github.com/molly))
|
||||
- [#5759](https://github.com/facebook/docusaurus/pull/5759) docs: create SEO documentation page ([@cerkiewny](https://github.com/cerkiewny))
|
||||
- [#5869](https://github.com/facebook/docusaurus/pull/5869) docs: remove duplicated appId property ([@juzhiyuan](https://github.com/juzhiyuan))
|
||||
- [#5868](https://github.com/facebook/docusaurus/pull/5868) docs: fix a typo in using-themes.md ([@fishmandev](https://github.com/fishmandev))
|
||||
- [#5862](https://github.com/facebook/docusaurus/pull/5862) misc: show only latest archive alpha/beta versions dropdown ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus`
|
||||
- [#5742](https://github.com/facebook/docusaurus/pull/5742) feat(website): redesign of showcase page ([@chimailo](https://github.com/chimailo))
|
||||
|
||||
#### :house: Internal
|
||||
|
||||
- `create-docusaurus`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-pwa`, `docusaurus-theme-common`, `docusaurus-theme-translations`, `docusaurus-utils-validation`, `docusaurus`
|
||||
- [#6071](https://github.com/facebook/docusaurus/pull/6071) refactor: add blank lines below all copyright headers ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- Other
|
||||
- [#6068](https://github.com/facebook/docusaurus/pull/6068) chore: add prefix to needs triage label; separate Windows test workflow ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#6031](https://github.com/facebook/docusaurus/pull/6031) chore: upgrade netlify-cli ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#6012](https://github.com/facebook/docusaurus/pull/6012) chore(website): enable strict compiler option ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#6002](https://github.com/facebook/docusaurus/pull/6002) chore(ci): add GitHub action for showcase testing ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5977](https://github.com/facebook/docusaurus/pull/5977) chore: generate dogfooding test for long pathname during CI ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5950](https://github.com/facebook/docusaurus/pull/5950) misc(codeowners): add @Josh-Cena to CODEOWNERS ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5919](https://github.com/facebook/docusaurus/pull/5919) misc(workflow): E2E tests should not be run with website changes ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5907](https://github.com/facebook/docusaurus/pull/5907) chore(workflow): merge jobs into one workflow & give each job a name ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5889](https://github.com/facebook/docusaurus/pull/5889) chore(website): enable eslint in website ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5870](https://github.com/facebook/docusaurus/pull/5870) chore(README): fix broken Github Actions Workflow Status icon ([@HemantSachdeva](https://github.com/HemantSachdeva))
|
||||
- `docusaurus-module-type-aliases`, `docusaurus-types`, `docusaurus`
|
||||
- [#6064](https://github.com/facebook/docusaurus/pull/6064) refactor(core): fix types for client code ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `create-docusaurus`, `docusaurus-mdx-loader`, `docusaurus-migrate`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-pwa`, `docusaurus-plugin-sitemap`, `docusaurus-theme-translations`, `docusaurus-utils`, `docusaurus`
|
||||
- [#6055](https://github.com/facebook/docusaurus/pull/6055) chore: clean up dev dependency declarations ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `create-docusaurus`, `docusaurus-plugin-ideal-image`, `docusaurus-theme-classic`
|
||||
- [#6010](https://github.com/facebook/docusaurus/pull/6010) chore: upgrade prettier; rename prettier scripts as format ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `create-docusaurus`, `docusaurus`
|
||||
- [#5958](https://github.com/facebook/docusaurus/pull/5958) chore: update @svgr/webpack to version 6 ([@ludofischer](https://github.com/ludofischer))
|
||||
- `docusaurus`
|
||||
- [#5998](https://github.com/facebook/docusaurus/pull/5998) chore: upgrade webpack-dev-server to v4.5.0 ([@lex111](https://github.com/lex111))
|
||||
- [#5965](https://github.com/facebook/docusaurus/pull/5965) fix(core): apply staticDirectories to base webpack config ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-mdx-loader`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-debug`, `docusaurus-plugin-ideal-image`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-utils-common`, `docusaurus-utils`, `docusaurus`
|
||||
- [#5985](https://github.com/facebook/docusaurus/pull/5985) chore: cleanup dependency declaration in package.json ([@armano2](https://github.com/armano2))
|
||||
- `create-docusaurus`, `docusaurus-migrate`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-debug`, `docusaurus-plugin-google-gtag`, `docusaurus-plugin-sitemap`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-theme-search-algolia`, `docusaurus-utils`, `docusaurus`, `lqip-loader`, `stylelint-copyright`
|
||||
- [#5963](https://github.com/facebook/docusaurus/pull/5963) chore: upgrade TypeScript & other ESLint related deps ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-plugin-content-docs`
|
||||
- [#5962](https://github.com/facebook/docusaurus/pull/5962) refactor(content-docs): move isCategoriesShorthand to utils ([@armano2](https://github.com/armano2))
|
||||
- [#5906](https://github.com/facebook/docusaurus/pull/5906) fix(content-docs): do not echo git history to console ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5905](https://github.com/facebook/docusaurus/pull/5905) misc(plugin-docs): fix Windows test snapshot for git history retrieval ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5904](https://github.com/facebook/docusaurus/pull/5904) refactor(content-docs): use shelljs instead of execa ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-plugin-ideal-image`
|
||||
- [#5940](https://github.com/facebook/docusaurus/pull/5940) refactor(plugin-ideal-image): migrate package to TS ([@armano2](https://github.com/armano2))
|
||||
- `docusaurus-plugin-pwa`, `docusaurus-theme-classic`
|
||||
- [#5941](https://github.com/facebook/docusaurus/pull/5941) refactor(plugin-pwa): migrate package to TS ([@armano2](https://github.com/armano2))
|
||||
- `docusaurus-plugin-ideal-image`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-search-algolia`
|
||||
- [#5935](https://github.com/facebook/docusaurus/pull/5935) refactor(theme-search-algolia): migrate package to TS ([@armano2](https://github.com/armano2))
|
||||
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`
|
||||
- [#5946](https://github.com/facebook/docusaurus/pull/5946) refactor: move deps declarations into src ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-debug`, `docusaurus-plugin-google-gtag`, `docusaurus-plugin-ideal-image`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-utils-common`, `docusaurus-utils`, `docusaurus`
|
||||
- [#5914](https://github.com/facebook/docusaurus/pull/5914) refactor: improve setup of type declaration files ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-theme-classic`, `docusaurus-theme-common`
|
||||
- [#5922](https://github.com/facebook/docusaurus/pull/5922) refactor(theme-classic): move some logic of CodeBlock to theme-common ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `docusaurus-remark-plugin-npm2yarn`
|
||||
- [#5931](https://github.com/facebook/docusaurus/pull/5931) refactor(remark-plugin-npm2yarn): migrate package to TS ([@duanwilliam](https://github.com/duanwilliam))
|
||||
- `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-utils`
|
||||
- [#5806](https://github.com/facebook/docusaurus/pull/5806) refactor: use js-yaml to parse both JSON and YAML ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
|
||||
#### Committers: 48
|
||||
|
||||
- Afshin Mehrabani ([@afshinm](https://github.com/afshinm))
|
||||
- Alexey Pyltsyn ([@lex111](https://github.com/lex111))
|
||||
- Armano ([@armano2](https://github.com/armano2))
|
||||
- Brennan Kinney ([@polarathene](https://github.com/polarathene))
|
||||
- Can Olcer ([@shafy](https://github.com/shafy))
|
||||
- Christophe Chaudier ([@cchaudier](https://github.com/cchaudier))
|
||||
- Devtato ([@cerkiewny](https://github.com/cerkiewny))
|
||||
- Dmitriy Fishman ([@fishmandev](https://github.com/fishmandev))
|
||||
- Don ([@dsmmcken](https://github.com/dsmmcken))
|
||||
- FISH UP ([@MisterFISHUP](https://github.com/MisterFISHUP))
|
||||
- Fernando Maia ([@fsmaia](https://github.com/fsmaia))
|
||||
- Hemant Sachdeva ([@HemantSachdeva](https://github.com/HemantSachdeva))
|
||||
- Hendrik Bulens ([@hbulens](https://github.com/hbulens))
|
||||
- Ivan Boothe ([@rootwork](https://github.com/rootwork))
|
||||
- Jarar ([@JararvisQ](https://github.com/JararvisQ))
|
||||
- Jeff Shillitto ([@jeffski](https://github.com/jeffski))
|
||||
- Joshua Chen ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- Konstantin Popov ([@KonstHardy](https://github.com/KonstHardy))
|
||||
- Ludovico Fischer ([@ludofischer](https://github.com/ludofischer))
|
||||
- Martin Šošić ([@Martinsos](https://github.com/Martinsos))
|
||||
- Matej Jellus ([@juffalow](https://github.com/juffalow))
|
||||
- Matthijs Groen ([@matthijsgroen](https://github.com/matthijsgroen))
|
||||
- Molly White ([@molly](https://github.com/molly))
|
||||
- Morooka Kotaro ([@MorookaKotaro](https://github.com/MorookaKotaro))
|
||||
- Oliver Ullman ([@oriooctopus](https://github.com/oriooctopus))
|
||||
- Paden Clayton ([@spyke01](https://github.com/spyke01))
|
||||
- Patitotective ([@Patitotective](https://github.com/Patitotective))
|
||||
- Patrik Mäsiar ([@patrikmasiar](https://github.com/patrikmasiar))
|
||||
- Paul Biggar ([@pbiggar](https://github.com/pbiggar))
|
||||
- Rey ([@rsapkf](https://github.com/rsapkf))
|
||||
- Robin Métral ([@robinmetral](https://github.com/robinmetral))
|
||||
- Rohit Agrawal ([@agrawal-rohit](https://github.com/agrawal-rohit))
|
||||
- Ronny Roeller ([@ronnyroeller](https://github.com/ronnyroeller))
|
||||
- Sergio Moreno ([@semoal](https://github.com/semoal))
|
||||
- Sharon Koech ([@skoech](https://github.com/skoech))
|
||||
- Shoaib Sajid ([@dexbiobot](https://github.com/dexbiobot))
|
||||
- Soham Shah ([@sohamsshah](https://github.com/sohamsshah))
|
||||
- Stan Kocken ([@StanKocken](https://github.com/StanKocken))
|
||||
- Swalah Amani ([@swalahamani](https://github.com/swalahamani))
|
||||
- Swapnil M Mane ([@swapnilmmane](https://github.com/swapnilmmane))
|
||||
- Sébastien Lorber ([@slorber](https://github.com/slorber))
|
||||
- Varun Sivapalan ([@sivapalan](https://github.com/sivapalan))
|
||||
- William Poetra Yoga ([@wpyoga](https://github.com/wpyoga))
|
||||
- Yongmin Hong ([@revi](https://github.com/revi))
|
||||
- [@duanwilliam](https://github.com/duanwilliam)
|
||||
- [@pal-sig](https://github.com/pal-sig)
|
||||
- chima ilo ([@chimailo](https://github.com/chimailo))
|
||||
- 琚致远 ([@juzhiyuan](https://github.com/juzhiyuan))
|
||||
|
||||
## 2.0.0-beta.9 (2021-11-02)
|
||||
|
||||
#### :rocket: New Feature
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "new.docusaurus.io",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "netlify dev"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"changelog": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "create-docusaurus",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Create Docusaurus apps easily.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docusaurus-2-classic-typescript-template",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
@ -15,8 +15,8 @@
|
|||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.9",
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.10",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"clsx": "^1.1.1",
|
||||
"prism-react-renderer": "^1.2.1",
|
||||
|
@ -24,7 +24,7 @@
|
|||
"react-dom": "^17.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.10",
|
||||
"@tsconfig/docusaurus": "^1.0.4",
|
||||
"typescript": "^4.5.2"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docusaurus-2-classic-template",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
@ -14,8 +14,8 @@
|
|||
"write-heading-ids": "docusaurus write-heading-ids"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.9",
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.10",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"clsx": "^1.1.1",
|
||||
"prism-react-renderer": "^1.2.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docusaurus-2-facebook-template",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"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.9",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.9",
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.10",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"clsx": "^1.1.1",
|
||||
"react": "^17.0.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/cssnano-preset",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Advanced cssnano preset for maximum optimization.",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/mdx-loader",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Docusaurus Loader for MDX",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/mdx-loader.d.ts",
|
||||
|
@ -20,7 +20,7 @@
|
|||
"dependencies": {
|
||||
"@babel/parser": "^7.16.4",
|
||||
"@babel/traverse": "^7.16.3",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@mdx-js/mdx": "^1.6.21",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"chalk": "^4.1.2",
|
||||
|
@ -37,7 +37,7 @@
|
|||
"webpack": "^5.61.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/types": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"@types/escape-html": "^1.0.1",
|
||||
"@types/mdast": "^3.0.7",
|
||||
"@types/stringify-object": "^3.3.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/migrate",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "A CLI tool to migrate from older versions of Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/module-type-aliases",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"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.9",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"@types/react": "*",
|
||||
"@types/react-helmet": "*",
|
||||
"@types/react-router-config": "*",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-client-redirects",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Client redirects plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-client-redirects.d.ts",
|
||||
|
@ -18,9 +18,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-common": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-common": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"chalk": "^4.1.2",
|
||||
"eta": "^1.12.3",
|
||||
"fs-extra": "^10.0.0",
|
||||
|
@ -28,8 +28,8 @@
|
|||
"tslib": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9"
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-content-blog",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Blog plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-content-blog.d.ts",
|
||||
|
@ -18,9 +18,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/mdx-loader": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/mdx-loader": "2.0.0-beta.10",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"chalk": "^4.1.2",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"feed": "^4.2.2",
|
||||
|
@ -36,8 +36,8 @@
|
|||
"webpack": "^5.61.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9"
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-content-docs",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Docs plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-content-docs.d.ts",
|
||||
|
@ -18,9 +18,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/mdx-loader": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/mdx-loader": "2.0.0-beta.10",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"chalk": "^4.1.2",
|
||||
"combine-promises": "^1.1.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
|
@ -37,9 +37,9 @@
|
|||
"webpack": "^5.61.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9",
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"@types/js-yaml": "^4.0.0",
|
||||
"@types/picomatch": "^2.2.1",
|
||||
"commander": "^5.1.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-content-pages",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Pages plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-content-pages.d.ts",
|
||||
|
@ -18,17 +18,17 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/mdx-loader": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/mdx-loader": "2.0.0-beta.10",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"globby": "^11.0.2",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"tslib": "^2.3.1",
|
||||
"webpack": "^5.61.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9"
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-debug",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Debug plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-debug.d.ts",
|
||||
|
@ -18,14 +18,14 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"fs-extra": "^10.0.0",
|
||||
"react-json-view": "^1.21.3",
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9"
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-google-analytics",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Global analytics (analytics.js) plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-google-analytics.d.ts",
|
||||
|
@ -18,11 +18,11 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9"
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9"
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-google-gtag",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Global Site Tag (gtag.js) plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-google-gtag.d.ts",
|
||||
|
@ -18,11 +18,11 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9"
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9"
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-ideal-image",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"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,7 +21,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/lqip-loader": "2.0.0-beta.9",
|
||||
"@docusaurus/lqip-loader": "2.0.0-beta.10",
|
||||
"@docusaurus/responsive-loader": "1.5.0",
|
||||
"@endiliey/react-ideal-image": "^0.0.11",
|
||||
"react-waypoint": "^10.1.0",
|
||||
|
@ -30,8 +30,8 @@
|
|||
"webpack": "^5.61.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9",
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"fs-extra": "^10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-pwa",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Docusaurus Plugin to add PWA support.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-pwa.d.ts",
|
||||
|
@ -23,10 +23,10 @@
|
|||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
||||
"@babel/preset-env": "^7.16.4",
|
||||
"@docusaurus/theme-common": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-translations": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-common": "2.0.0-beta.10",
|
||||
"@docusaurus/theme-translations": "2.0.0-beta.10",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"babel-loader": "^8.2.2",
|
||||
"clsx": "^1.1.1",
|
||||
"core-js": "^3.18.0",
|
||||
|
@ -38,7 +38,7 @@
|
|||
"workbox-window": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.10",
|
||||
"fs-extra": "^10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/plugin-sitemap",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Simple sitemap generation plugin for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/plugin-sitemap.d.ts",
|
||||
|
@ -18,16 +18,16 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-common": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-common": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"fs-extra": "^10.0.0",
|
||||
"sitemap": "^7.0.0",
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9"
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/preset-classic",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Classic preset for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/preset-classic.d.ts",
|
||||
|
@ -18,15 +18,15 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/plugin-content-blog": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-content-docs": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-content-pages": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-debug": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-google-analytics": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-google-gtag": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-sitemap": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-classic": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-search-algolia": "2.0.0-beta.9"
|
||||
"@docusaurus/plugin-content-blog": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-content-docs": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-content-pages": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-debug": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-google-analytics": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-google-gtag": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-sitemap": "2.0.0-beta.10",
|
||||
"@docusaurus/theme-classic": "2.0.0-beta.10",
|
||||
"@docusaurus/theme-search-algolia": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/remark-plugin-npm2yarn",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Remark plugin for converting npm commands to Yarn commands as tabs.",
|
||||
"main": "lib/index.js",
|
||||
"publishConfig": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-classic",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Classic theme for Docusaurus",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/theme-classic.d.ts",
|
||||
|
@ -23,13 +23,13 @@
|
|||
"update-code-translations": "node -e 'require(\"./update-code-translations.js\").run()'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/plugin-content-blog": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-content-docs": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-content-pages": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-common": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-translations": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-content-blog": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-content-docs": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-content-pages": "2.0.0-beta.10",
|
||||
"@docusaurus/theme-common": "2.0.0-beta.10",
|
||||
"@docusaurus/theme-translations": "2.0.0-beta.10",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"@mdx-js/mdx": "^1.6.21",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"chalk": "^4.1.2",
|
||||
|
@ -45,8 +45,8 @@
|
|||
"rtlcss": "^3.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9",
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"@types/mdx-js__react": "^1.5.4",
|
||||
"@types/parse-numeric-range": "^0.0.1",
|
||||
"@types/rtlcss": "^3.1.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-common",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Common code for Docusaurus themes.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
@ -18,9 +18,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/plugin-content-blog": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-content-docs": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-content-pages": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-content-blog": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-content-docs": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-content-pages": "2.0.0-beta.10",
|
||||
"clsx": "^1.1.1",
|
||||
"fs-extra": "^10.0.0",
|
||||
"parse-numeric-range": "^1.3.0",
|
||||
|
@ -28,8 +28,8 @@
|
|||
"utility-types": "^3.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9",
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"@testing-library/react-hooks": "^7.0.2",
|
||||
"lodash": "^4.17.20"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-live-codeblock",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Docusaurus live code block component.",
|
||||
"main": "lib/index.js",
|
||||
"publishConfig": {
|
||||
|
@ -17,9 +17,9 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/theme-translations": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-translations": "2.0.0-beta.10",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"@philpl/buble": "^0.19.7",
|
||||
"clsx": "^1.1.1",
|
||||
"fs-extra": "^10.0.0",
|
||||
|
@ -28,8 +28,8 @@
|
|||
"react-live": "2.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9",
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"@types/buble": "^0.20.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-search-algolia",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Algolia search component for Docusaurus.",
|
||||
"main": "lib/index.js",
|
||||
"types": "src/theme-search-algolia.d.ts",
|
||||
|
@ -21,10 +21,10 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@docsearch/react": "^3.0.0-alpha.39",
|
||||
"@docusaurus/theme-common": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-translations": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-common": "2.0.0-beta.10",
|
||||
"@docusaurus/theme-translations": "2.0.0-beta.10",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"algoliasearch": "^4.10.5",
|
||||
"algoliasearch-helper": "^3.5.5",
|
||||
"clsx": "^1.1.1",
|
||||
|
@ -32,7 +32,7 @@
|
|||
"lodash": "^4.17.20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.10",
|
||||
"fs-extra": "^10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/theme-translations",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Docusaurus theme translations.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/types",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Common types for Docusaurus packages.",
|
||||
"types": "./src/index.d.ts",
|
||||
"publishConfig": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/utils-common",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Common (Node/Browser) utility functions for Docusaurus packages.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
@ -21,7 +21,7 @@
|
|||
"tslib": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/types": "2.0.0-beta.9"
|
||||
"@docusaurus/types": "2.0.0-beta.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/utils-validation",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Node validation utility functions for Docusaurus packages.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"chalk": "^4.1.2",
|
||||
"joi": "^17.4.2",
|
||||
"tslib": "^2.3.1"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/utils",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Node utility functions for Docusaurus packages.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
@ -39,7 +39,7 @@
|
|||
"node": ">=14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/types": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"@types/dedent": "^0.7.0",
|
||||
"@types/github-slugger": "^1.3.0",
|
||||
"@types/micromatch": "^4.0.2",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@docusaurus/core",
|
||||
"description": "Easy to Maintain Open Source Documentation Websites",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@ -41,12 +41,12 @@
|
|||
"@babel/runtime": "^7.16.3",
|
||||
"@babel/runtime-corejs3": "^7.16.3",
|
||||
"@babel/traverse": "^7.16.3",
|
||||
"@docusaurus/cssnano-preset": "2.0.0-beta.9",
|
||||
"@docusaurus/mdx-loader": "2.0.0-beta.9",
|
||||
"@docusaurus/cssnano-preset": "2.0.0-beta.10",
|
||||
"@docusaurus/mdx-loader": "2.0.0-beta.10",
|
||||
"@docusaurus/react-loadable": "5.5.2",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-common": "2.0.0-beta.9",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-common": "2.0.0-beta.10",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
||||
"@slorber/static-site-generator-webpack-plugin": "^4.0.0",
|
||||
"@svgr/webpack": "^6.0.0",
|
||||
"autoprefixer": "^10.3.5",
|
||||
|
@ -108,8 +108,8 @@
|
|||
"webpackbar": "^5.0.0-3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
|
||||
"@docusaurus/types": "2.0.0-beta.9",
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.10",
|
||||
"@docusaurus/types": "2.0.0-beta.10",
|
||||
"@types/copy-webpack-plugin": "^8.0.1",
|
||||
"@types/css-minimizer-webpack-plugin": "^3.0.2",
|
||||
"@types/detect-port": "^1.3.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@docusaurus/lqip-loader",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Low Quality Image Placeholders (LQIP) loader for webpack.",
|
||||
"main": "lib/index.js",
|
||||
"publishConfig": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "stylelint-copyright",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"description": "Stylelint plugin to check CSS files for a copyright header.",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "website",
|
||||
"version": "2.0.0-beta.9",
|
||||
"version": "2.0.0-beta.10",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
@ -31,14 +31,14 @@
|
|||
"dependencies": {
|
||||
"@crowdin/cli": "^3.7.1",
|
||||
"@crowdin/crowdin-api-client": "^1.10.6",
|
||||
"@docusaurus/core": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-client-redirects": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-ideal-image": "2.0.0-beta.9",
|
||||
"@docusaurus/plugin-pwa": "2.0.0-beta.9",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.9",
|
||||
"@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.9",
|
||||
"@docusaurus/theme-live-codeblock": "2.0.0-beta.9",
|
||||
"@docusaurus/utils": "2.0.0-beta.9",
|
||||
"@docusaurus/core": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-client-redirects": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-ideal-image": "2.0.0-beta.10",
|
||||
"@docusaurus/plugin-pwa": "2.0.0-beta.10",
|
||||
"@docusaurus/preset-classic": "2.0.0-beta.10",
|
||||
"@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.10",
|
||||
"@docusaurus/theme-live-codeblock": "2.0.0-beta.10",
|
||||
"@docusaurus/utils": "2.0.0-beta.10",
|
||||
"@popperjs/core": "^2.10.2",
|
||||
"clsx": "^1.1.1",
|
||||
"color": "^4.0.1",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 0
|
||||
id: docusaurus.config.js
|
||||
description: API reference for Docusaurus configuration file.
|
||||
slug: /api/docusaurus-config
|
||||
|
@ -194,6 +195,18 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
### `deploymentBranch` {#deploymentbranch}
|
||||
|
||||
- Type: `string`
|
||||
|
||||
The name of the branch to deploy the static files to. Used by the deployment command.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
deploymentBranch: 'gh-pages',
|
||||
};
|
||||
```
|
||||
|
||||
### `githubHost` {#githubhost}
|
||||
|
||||
- Type: `string`
|
||||
|
@ -252,6 +265,8 @@ module.exports = {
|
|||
logo: {
|
||||
alt: 'Site Logo',
|
||||
src: 'img/logo.svg',
|
||||
width: 32,
|
||||
height: 32,
|
||||
},
|
||||
items: [
|
||||
{
|
||||
|
@ -280,6 +295,8 @@ module.exports = {
|
|||
logo: {
|
||||
alt: 'Facebook Open Source Logo',
|
||||
src: 'https://docusaurus.io/img/oss_logo.png',
|
||||
width: 160,
|
||||
height: 51,
|
||||
},
|
||||
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`, // You can also put own HTML here
|
||||
},
|
||||
|
@ -344,6 +361,20 @@ Attempting to add unknown field in the config will lead to error in build time:
|
|||
Error: The field(s) 'foo', 'bar' are not recognized in docusaurus.config.js
|
||||
```
|
||||
|
||||
### `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.
|
||||
|
||||
- Type: `string[]`
|
||||
|
||||
Example:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
staticDirectories: ['static'],
|
||||
};
|
||||
```
|
||||
|
||||
### `scripts` {#scripts}
|
||||
|
||||
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>`.
|
||||
|
@ -399,8 +430,11 @@ module.exports = {
|
|||
<html <%~ it.htmlAttributes %>>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=3.0, minimum-scale=0.86">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="generator" content="Docusaurus v<%= it.version %>">
|
||||
<% if (it.noIndex) { %>
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<% } %>
|
||||
<%~ it.headTags %>
|
||||
<% it.metaAttributes.forEach((metaAttribute) => { %>
|
||||
<%~ metaAttribute %>
|
||||
|
@ -412,20 +446,17 @@ module.exports = {
|
|||
<link rel="preload" href="<%= it.baseUrl %><%= script %>" as="script">
|
||||
<% }); %>
|
||||
</head>
|
||||
<body <%~ it.bodyAttributes %> itemscope="" itemtype="http://schema.org/Organization">
|
||||
<body <%~ it.bodyAttributes %>>
|
||||
<%~ it.preBodyTags %>
|
||||
<div id="__docusaurus">
|
||||
<%~ it.appHtml %>
|
||||
</div>
|
||||
<div id="outside-docusaurus">
|
||||
<span>Custom markup</span>
|
||||
</div>
|
||||
<% it.scripts.forEach((script) => { %>
|
||||
<script src="<%= it.baseUrl %><%= script %>"></script>
|
||||
<% }); %>
|
||||
<%~ it.postBodyTags %>
|
||||
</body>
|
||||
</html>
|
||||
</html>`,
|
||||
};
|
||||
```
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
sidebar_position: 1
|
||||
id: lifecycle-apis
|
||||
title: Lifecycle APIs
|
||||
slug: /lifecycle-apis
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
label: Plugins
|
||||
position: 2
|
||||
link:
|
||||
type: doc
|
||||
id: api/plugins/plugins-overview # Dogfood using a "qualified id"
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 0
|
||||
id: plugins-overview
|
||||
title: 'Docusaurus plugins'
|
||||
sidebar_label: Plugins overview
|
||||
|
@ -9,7 +10,7 @@ We provide official Docusaurus plugins.
|
|||
|
||||
## Content plugins {#content-plugins}
|
||||
|
||||
These plugins are responsible to load your site's content, and create pages for your theme to render.
|
||||
These plugins are responsible for loading your site's content, and creating pages for your theme to render.
|
||||
|
||||
- [@docusaurus/plugin-content-docs](./plugin-content-docs.md)
|
||||
- [@docusaurus/plugin-content-blog](./plugin-content-blog.md)
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 4
|
||||
id: plugin-client-redirects
|
||||
title: '📦 plugin-client-redirects'
|
||||
slug: '/api/plugins/@docusaurus/plugin-client-redirects'
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 2
|
||||
id: plugin-content-blog
|
||||
title: '📦 plugin-content-blog'
|
||||
slug: '/api/plugins/@docusaurus/plugin-content-blog'
|
||||
|
@ -61,6 +62,7 @@ Accepted fields:
|
|||
| `feedOptions.description` | `string` | <code>\`${siteConfig.title} Blog\`</code> | Description of the feed. |
|
||||
| `feedOptions.copyright` | `string` | `undefined` | Copyright message. |
|
||||
| `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. |
|
||||
| `sortPosts` | <code>'descending' \| 'ascending' </code> | `'descending'` | Governs the direction of blog post sorting. |
|
||||
|
||||
</APITable>
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 1
|
||||
id: plugin-content-docs
|
||||
title: '📦 plugin-content-docs'
|
||||
slug: '/api/plugins/@docusaurus/plugin-content-docs'
|
||||
|
@ -47,6 +48,7 @@ Accepted fields:
|
|||
| `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. |
|
||||
| `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. |
|
||||
| `beforeDefaultRemarkPlugins` | `any[]` | `[]` | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins. |
|
||||
|
@ -248,7 +250,7 @@ Accepted fields:
|
|||
| `title` | `string` | Markdown title or `id` | The text title of your document. Used for the page metadata and as a fallback value in multiple places (sidebar, next/previous buttons...). Automatically added at the top of your doc if it does not contain any Markdown title. |
|
||||
| `pagination_label` | `string` | `sidebar_label` or `title` | The text used in the document next/previous buttons for this document. |
|
||||
| `sidebar_label` | `string` | `title` | The text shown in the document sidebar for this document. |
|
||||
| `sidebar_position` | `number` | Default ordering | Controls the position of a doc inside the generated sidebar slice when using `autogenerated` sidebar items. See also [Autogenerated sidebar metadatas](/docs/sidebar#autogenerated-sidebar-metadatas). |
|
||||
| `sidebar_position` | `number` | Default ordering | Controls the position of a doc inside the generated sidebar slice when using `autogenerated` sidebar items. See also [Autogenerated sidebar metadata](/docs/sidebar#autogenerated-sidebar-metadata). |
|
||||
| `sidebar_class_name` | `string` | `undefined` | Gives the corresponding sidebar label a special class name when using autogenerated sidebars. |
|
||||
| `hide_title` | `boolean` | `false` | Whether to hide the title at the top of the doc. It only hides a title declared through the frontmatter, and have no effect on a Markdown title at the top of your document. |
|
||||
| `hide_table_of_contents` | `boolean` | `false` | Whether to hide the table of contents to the right. |
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 3
|
||||
id: plugin-content-pages
|
||||
title: '📦 plugin-content-pages'
|
||||
slug: '/api/plugins/@docusaurus/plugin-content-pages'
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 5
|
||||
id: plugin-debug
|
||||
title: '📦 plugin-debug'
|
||||
slug: '/api/plugins/@docusaurus/plugin-debug'
|
|
@ -0,0 +1,94 @@
|
|||
---
|
||||
sidebar_position: 6
|
||||
id: plugin-google-analytics
|
||||
title: '📦 plugin-google-analytics'
|
||||
slug: '/api/plugins/@docusaurus/plugin-google-analytics'
|
||||
---
|
||||
|
||||
The default [Google Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/) plugin. It is a JavaScript library for measuring how users interact with your website **in the production build**. If you are using Google Analytics 4 you might need to consider using [plugin-google-gtag](./plugin-google-gtag.md) instead.
|
||||
|
||||
## Installation {#installation}
|
||||
|
||||
```bash npm2yarn
|
||||
npm install --save @docusaurus/plugin-google-analytics
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
If you have installed `@docusaurus/preset-classic`, you don't need to install it as a dependency.
|
||||
|
||||
:::
|
||||
|
||||
## Configuration {#configuration}
|
||||
|
||||
Accepted fields:
|
||||
|
||||
<small>
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `trackingID` | `string` | **Required** | The tracking ID of your analytics service. |
|
||||
| `anonymizeIP` | `boolean` | `false` | Whether the IP should be anonymized when sending requests. |
|
||||
|
||||
</small>
|
||||
|
||||
## Example configuration {#ex-config}
|
||||
|
||||
Here's an example configuration object.
|
||||
|
||||
You can provide it as [preset options](#ex-config-preset) or [plugin options](#ex-config-plugin).
|
||||
|
||||
:::tip
|
||||
|
||||
Most Docusaurus users configure this plugin through the [preset options](#ex-config-preset).
|
||||
|
||||
:::
|
||||
|
||||
```js
|
||||
const config = {
|
||||
trackingID: 'UA-141789564-1',
|
||||
anonymizeIP: true,
|
||||
};
|
||||
```
|
||||
|
||||
### Preset options {#ex-config-preset}
|
||||
|
||||
If you use a preset, configure this plugin through the [preset options](presets.md#docusauruspreset-classic):
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
// highlight-start
|
||||
googleAnalytics: {
|
||||
trackingID: 'UA-141789564-1',
|
||||
anonymizeIP: true,
|
||||
},
|
||||
// highlight-end
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Plugin options {#ex-config-plugin}
|
||||
|
||||
If you are using a standalone plugin, provide options directly to the plugin:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-google-analytics',
|
||||
// highlight-start
|
||||
{
|
||||
trackingID: 'UA-141789564-1',
|
||||
anonymizeIP: true,
|
||||
},
|
||||
// highlight-end
|
||||
],
|
||||
],
|
||||
};
|
||||
```
|
|
@ -0,0 +1,100 @@
|
|||
---
|
||||
sidebar_position: 7
|
||||
id: plugin-google-gtag
|
||||
title: '📦 plugin-google-gtag'
|
||||
slug: '/api/plugins/@docusaurus/plugin-google-gtag'
|
||||
---
|
||||
|
||||
The default [Global Site Tag (gtag.js)](https://developers.google.com/analytics/devguides/collection/gtagjs/) plugin. It is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform, **in the production build**. This section describes how to configure a Docusaurus site to enable global site tag for Google Analytics.
|
||||
|
||||
:::tip
|
||||
|
||||
You can use [Google's Tag Assistant](https://tagassistant.google.com/) tool to check if your gtag is set up correctly!
|
||||
|
||||
:::
|
||||
|
||||
## Installation {#installation}
|
||||
|
||||
```bash npm2yarn
|
||||
npm install --save @docusaurus/plugin-google-gtag
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
If you have installed `@docusaurus/preset-classic`, you don't need to install it as a dependency.
|
||||
|
||||
:::
|
||||
|
||||
## Configuration {#configuration}
|
||||
|
||||
Accepted fields:
|
||||
|
||||
<small>
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `trackingID` | `string` | **Required** | The tracking ID of your gtag service. |
|
||||
| `anonymizeIP` | `boolean` | `false` | Whether the IP should be anonymized when sending requests. |
|
||||
|
||||
</small>
|
||||
|
||||
## Example configuration {#ex-config}
|
||||
|
||||
Here's an example configuration object.
|
||||
|
||||
You can provide it as [preset options](#ex-config-preset) or [plugin options](#ex-config-plugin).
|
||||
|
||||
:::tip
|
||||
|
||||
Most Docusaurus users configure this plugin through the [preset options](#ex-config-preset).
|
||||
|
||||
:::
|
||||
|
||||
```js
|
||||
const config = {
|
||||
trackingID: 'UA-141789564-1',
|
||||
anonymizeIP: true,
|
||||
};
|
||||
```
|
||||
|
||||
### Preset options {#ex-config-preset}
|
||||
|
||||
If you use a preset, configure this plugin through the [preset options](presets.md#docusauruspreset-classic):
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
// highlight-start
|
||||
gtag: {
|
||||
trackingID: 'UA-141789564-1',
|
||||
anonymizeIP: true,
|
||||
},
|
||||
// highlight-end
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Plugin options {#ex-config-plugin}
|
||||
|
||||
If you are using a standalone plugin, provide options directly to the plugin:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-google-gtag',
|
||||
// highlight-start
|
||||
{
|
||||
trackingID: 'UA-141789564-1',
|
||||
anonymizeIP: true,
|
||||
},
|
||||
// highlight-end
|
||||
],
|
||||
],
|
||||
};
|
||||
```
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 8
|
||||
id: plugin-ideal-image
|
||||
title: '📦 plugin-ideal-image'
|
||||
slug: '/api/plugins/@docusaurus/plugin-ideal-image'
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 9
|
||||
id: plugin-pwa
|
||||
title: '📦 plugin-pwa'
|
||||
slug: '/api/plugins/@docusaurus/plugin-pwa'
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 10
|
||||
id: plugin-sitemap
|
||||
title: '📦 plugin-sitemap'
|
||||
slug: '/api/plugins/@docusaurus/plugin-sitemap'
|
|
@ -0,0 +1,5 @@
|
|||
label: Themes
|
||||
position: 3
|
||||
link:
|
||||
type: doc
|
||||
id: themes-overview # Dogfood using a "local id"
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 0
|
||||
id: themes-overview
|
||||
title: 'Docusaurus themes'
|
||||
sidebar_label: Themes overview
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 2
|
||||
id: theme-classic
|
||||
title: '📦 theme-classic'
|
||||
slug: '/api/themes/@docusaurus/theme-classic'
|
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
sidebar_position: 1
|
||||
id: theme-configuration
|
||||
title: 'Theme configuration'
|
||||
sidebar_label: 'Configuration'
|
||||
slug: '/api/themes/configuration'
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
@ -95,9 +97,9 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
### Metadatas {#metadatas}
|
||||
### Metadata {#metadata}
|
||||
|
||||
You can configure additional html metadatas (and override existing ones).
|
||||
You can configure additional html metadata (and override existing ones).
|
||||
|
||||
Accepted fields:
|
||||
|
||||
|
@ -105,7 +107,7 @@ Accepted fields:
|
|||
|
||||
| Name | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `metadatas` | `Metadata[]` | `[]` | Any field will be directly passed to the `<meta />` tag. Possible fields include `id`, `name`, `property`, `content`, `itemprop`, etc. |
|
||||
| `metadata` | `Metadata[]` | `[]` | Any field will be directly passed to the `<meta />` tag. Possible fields include `id`, `name`, `property`, `content`, `itemprop`, etc. |
|
||||
|
||||
</APITable>
|
||||
|
||||
|
@ -115,7 +117,7 @@ Example configuration:
|
|||
module.exports = {
|
||||
themeConfig: {
|
||||
// highlight-next-line
|
||||
metadatas: [{name: 'twitter:card', content: 'summary'}],
|
||||
metadata: [{name: 'twitter:card', content: 'summary'}],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
@ -189,6 +191,8 @@ Accepted fields:
|
|||
| `src` | `string` | **Required** | URL to the logo image. Base URL is appended by default. |
|
||||
| `srcDark` | `string` | `logo.src` | An alternative image URL to use in dark mode. |
|
||||
| `href` | `string` | `siteConfig.baseUrl` | Link to navigate to when the logo is clicked. |
|
||||
| `width` | <code>string \| number</code> | `undefined` | Specifies the `width` attribute. |
|
||||
| `height` | <code>string \| number</code> | `undefined` | Specifies the `height` attribute. |
|
||||
| `target` | `string` | Calculated based on `href` (external links will open in a new tab, all others in the current one). | The `target` attribute of the link; controls whether the link is opened in a new tab, the current one, or otherwise. |
|
||||
|
||||
</APITable>
|
||||
|
@ -207,6 +211,8 @@ module.exports = {
|
|||
srcDark: 'img/logo_dark.svg',
|
||||
href: 'https://docusaurus.io/',
|
||||
target: '_self',
|
||||
width: 32,
|
||||
height: 32,
|
||||
},
|
||||
// highlight-end
|
||||
},
|
||||
|
@ -681,6 +687,8 @@ module.exports = {
|
|||
alt: 'Facebook Open Source Logo',
|
||||
src: 'img/oss_logo.png',
|
||||
href: 'https://opensource.facebook.com',
|
||||
width: 160,
|
||||
height: 51,
|
||||
},
|
||||
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
|
||||
},
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 3
|
||||
id: theme-live-codeblock
|
||||
title: '📦 theme-live-codeblock'
|
||||
slug: '/api/themes/@docusaurus/theme-live-codeblock'
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
sidebar_position: 4
|
||||
id: theme-search-algolia
|
||||
title: '📦 theme-search-algolia'
|
||||
slug: '/api/themes/@docusaurus/theme-search-algolia'
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
@ -29,7 +29,7 @@ They are used in a number of places such as your site's title and headings, brow
|
|||
|
||||
### Deployment configurations {#deployment-configurations}
|
||||
|
||||
Deployment configurations such as `projectName` and `organizationName` are used when you deploy your site with the `deploy` command.
|
||||
Deployment configurations such as `projectName`, `organizationName`, and optionally `deploymentBranch` are used when you deploy your site with the `deploy` command.
|
||||
|
||||
It is recommended to check the [deployment docs](deployment.mdx) for more information.
|
||||
|
||||
|
@ -48,6 +48,65 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
Docusaurus supports **module shorthands**, allowing you to simplify the above configuration as:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
// ...
|
||||
plugins: ['content-blog', 'content-pages'],
|
||||
themes: ['classic'],
|
||||
};
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
<summary>How are shorthands resolved?</summary>
|
||||
|
||||
When it sees a plugin / theme / preset name, it tries to load one of the following, in that order:
|
||||
|
||||
- `{name}`
|
||||
- `@docusaurus/{type}-{name}`
|
||||
- `docusaurus-{type}-{name}`,
|
||||
|
||||
where `type` is one of `'preset'`, `'theme'`, `'plugin'`, depending on which field the module name is declared in. The first module name that's successfully found is loaded.
|
||||
|
||||
If the name is scoped (beginning with `@`), the name is first split into scope and package name by the first slash:
|
||||
|
||||
```
|
||||
@scope
|
||||
^----^
|
||||
scope (no name!)
|
||||
|
||||
@scope/awesome
|
||||
^----^ ^-----^
|
||||
scope name
|
||||
|
||||
@scope/awesome/main
|
||||
^----^ ^----------^
|
||||
scope name
|
||||
```
|
||||
|
||||
If the name is not specified, `{scope}/docusaurus-{type}` is loaded. Otherwise, the following are attempted:
|
||||
|
||||
- `{scope}/{name}`
|
||||
- `{scope}/docusaurus-{type}-{name}`
|
||||
|
||||
Below are some examples, for a plugin registered in the `plugins` field. Note that unlike [ESLint](https://eslint.org/docs/user-guide/configuring/plugins#configuring-plugins) or [Babel](https://babeljs.io/docs/en/options#name-normalization) where a consistent naming convention for plugins is mandated, Docusaurus permits greater naming freedom, so the resolutions are not certain, but follows the priority defined above.
|
||||
|
||||
| Declaration | May be resolved as |
|
||||
| --- | --- |
|
||||
| `awesome` | `docusaurus-plugin-awesome` |
|
||||
| `sitemap` | [`@docusaurus/plugin-sitemap`](./api/plugins/plugin-sitemap.md) |
|
||||
| `@mycompany` | `@mycompany/docusaurus-plugin` (the only possible resolution!) |
|
||||
| `@mycompany/awesome` | `@mycompany/docusaurus-plugin-awesome` |
|
||||
| `@mycompany/awesome/web` | `@mycompany/docusaurus-plugin-awesome/web` |
|
||||
|
||||
</details>
|
||||
|
||||
:::
|
||||
|
||||
They can also be loaded from local directories:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
|
@ -66,7 +125,7 @@ module.exports = {
|
|||
// ...
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-content-blog',
|
||||
'content-blog',
|
||||
{
|
||||
path: 'blog',
|
||||
routeBasePath: 'blog',
|
||||
|
@ -74,7 +133,7 @@ module.exports = {
|
|||
// ...
|
||||
},
|
||||
],
|
||||
'@docusaurus/plugin-content-pages',
|
||||
'content-pages',
|
||||
],
|
||||
};
|
||||
```
|
||||
|
@ -100,6 +159,12 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
The `presets: [['classic', {...}]]` shorthand works as well.
|
||||
|
||||
:::
|
||||
|
||||
For further help configuring themes, plugins, and presets, see [Using Themes](using-themes.md), [Using Plugins](using-plugins.md), and [Using Presets](presets.md).
|
||||
|
||||
### Custom configurations {#custom-configurations}
|
726
website/versioned_docs/version-2.0.0-beta.10/deployment.mdx
Normal file
726
website/versioned_docs/version-2.0.0-beta.10/deployment.mdx
Normal file
|
@ -0,0 +1,726 @@
|
|||
---
|
||||
id: deployment
|
||||
title: Deployment
|
||||
---
|
||||
|
||||
To build the static files of your website for production, run:
|
||||
|
||||
```bash npm2yarn
|
||||
npm run build
|
||||
```
|
||||
|
||||
Once it finishes, the static files will be generated within the `build` directory.
|
||||
|
||||
:::note
|
||||
|
||||
The only responsibility of Docusaurus is to build your site and emit static files in `build`.
|
||||
|
||||
It is now up to you to choose how to host those static files.
|
||||
|
||||
:::
|
||||
|
||||
You can deploy your site to static site hosting services such as [Vercel](https://vercel.com/), [GitHub Pages](https://pages.github.com/), [Netlify](https://www.netlify.com/), [Render](https://render.com/docs/static-sites), [Surge](https://surge.sh/help/getting-started-with-surge)...
|
||||
|
||||
A Docusaurus site is statically rendered, and it can generally work without JavaScript!
|
||||
|
||||
## Configuration {#configuration}
|
||||
|
||||
The following parameters are required in `docusaurus.config.js` in order for Docusaurus to optimize routing and serve files from the correct location:
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| `url` | URL for your site. For a site deployed at `https://my-org.com/my-project/`, `url` is `https://my-org.com/`. |
|
||||
| `baseUrl` | Base URL for your project, with a trailing slash. For a site deployed at `https://my-org.com/my-project/`, `baseUrl` is `/my-project/`. |
|
||||
|
||||
## Testing your Build Locally {#testing-build-locally}
|
||||
|
||||
It is important to test your build locally before deploying to production. Docusaurus provides a [`docusaurus serve`](cli.md#docusaurus-serve-sitedir) command for that:
|
||||
|
||||
```bash npm2yarn
|
||||
npm run serve
|
||||
```
|
||||
|
||||
By default, this will load your site at [http://localhost:3000/](http://localhost:3000/).
|
||||
|
||||
## 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.
|
||||
|
||||
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.
|
||||
|
||||
:::tip
|
||||
|
||||
Use [slorber/trailing-slash-guide](https://github.com/slorber/trailing-slash-guide) to understand better the behavior of your host and configure `trailingSlash` appropriately.
|
||||
|
||||
:::
|
||||
|
||||
## Choosing a hosting provider
|
||||
|
||||
There are a few common hosting options:
|
||||
|
||||
- [Self hosting](#self-hosting) with an HTTP server like Apache2 or Nginx;
|
||||
- Jamstack providers, e.g. [Netlify](#deploying-to-netlify) and [Vercel](#deploying-to-vercel). We will use them as references, but the same reasoning can apply to other providers.
|
||||
- [GitHub Pages](#deploying-to-github-pages). (By definition, it is also Jamstack, but we compare it separately.)
|
||||
|
||||
If you are unsure of which one to choose, ask the following questions:
|
||||
|
||||
<details>
|
||||
|
||||
<summary>
|
||||
How much resource (person-hours, money) am I willing to invest in this?
|
||||
</summary>
|
||||
|
||||
- 🔴 Self-hosting is the hardest to set up—you would usually need an experienced person to manage this. Cloud services is almost never free, and setting up an on-site server and connecting it to the WAN can be more costly.
|
||||
- 🟢 Jamstack providers can help you set up a working website in almost no time and offers features like server-side redirects that are easily configurable. Many providers offer generous build time quota even for free plans that you would almost never exceed. However, it's still ultimately limited—you would need to pay once you hit the limit. Check the pricing page of your provider for details.
|
||||
- 🟡 The GitHub Pages deployment workflow can be tedious to set up. (Evidence: see the length of [Deploying to GitHub Pages](#deploying-to-github-pages)!) However, this service (including build and deployment) is always free for public repositories, and we have detailed instructions to help you make it work.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary>How much server-side configuration would I need?</summary>
|
||||
|
||||
- 🟢 With self-hosting, you have access to the entire server's configuration. You can configure the virtual host to serve different content based on the request URL; you can do complicated server-side redirects; you can put part of the site behind authentication... If you need a lot of server-side features, self-host your website.
|
||||
- 🟡 Jamstack usually offers some server-side configurations, e.g. URLs formatting (trailing slashes), server-side redirects...
|
||||
- 🔴 GitHub Pages doesn't expose server-side configurations besides enforcing HTTPS and setting CNAME.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Do I have needs to cooperate?</summary>
|
||||
|
||||
- 🟡 Self-hosted services can achieve the same effect as Netlify, but with much more heavy-lifting. Usually, you would have a specific person who looks after the deployment, and the workflow won't be very git-based as opposed to the other two options.
|
||||
- 🟢 Netlify and Vercel have deploy previews for every pull request, which is useful for a team to review work before merging to production. You can also manage a team with different member access to the deployment.
|
||||
- 🟡 GitHub Pages cannot do deploy previews in a non-convoluted way. One repo can only be associated with one site deployment. On the other hand, you can control who has write access to the site's deployment.
|
||||
|
||||
</details>
|
||||
|
||||
There isn't a silver bullet. You need to weigh your needs and resources before making a choice.
|
||||
|
||||
## Self-Hosting {#self-hosting}
|
||||
|
||||
Docusaurus can be self-hosted using [`docusaurus serve`](cli.md#docusaurus-serve-sitedir). Change port using `--port` and `--host` to change host.
|
||||
|
||||
```bash npm2yarn
|
||||
npm run serve -- --build --port 80 --host 0.0.0.0
|
||||
```
|
||||
|
||||
:::warning
|
||||
|
||||
It is not the best option, compared to a static hosting provider / CDN.
|
||||
|
||||
:::
|
||||
|
||||
:::warning
|
||||
|
||||
In the following sections, we will introduce a few common hosting providers and how they should be configured to deploy Docusaurus sites most efficiently. Some of the writeups are provided by external contributors. Docusaurus is not interest-related with any of the services. The documentation may not be up-to-date: recent changes in their API may not be reflected on our side. If you see outdated content, PRs are welcome.
|
||||
|
||||
For the same concern of up-to-datedness, we have stopped accepting PRs adding new hosting options. You can, however, publish your writeup on a separate site (e.g. your blog, or the provider's official website), and ask us to include a link to your writeup.
|
||||
|
||||
:::
|
||||
|
||||
## Deploying to Netlify {#deploying-to-netlify}
|
||||
|
||||
To deploy your Docusaurus 2 sites to [Netlify](https://www.netlify.com/), first make sure the following options are properly configured:
|
||||
|
||||
```js {2-3} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
url: 'https://docusaurus-2.netlify.app', // Url to your site with no trailing slash
|
||||
baseUrl: '/', // Base directory of your site relative to your repo
|
||||
// ...
|
||||
};
|
||||
```
|
||||
|
||||
Then, [create your site with Netlify](https://app.netlify.com/start).
|
||||
|
||||
While you set up the site, specify the build commands and directories as follows:
|
||||
|
||||
- build command: `npm run build`
|
||||
- build directory: `build`
|
||||
|
||||
If you did not configure these build options, you may still go to "Site settings" -> "Build and deploy" after your site is created.
|
||||
|
||||
Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to `main`.
|
||||
|
||||
:::caution
|
||||
|
||||
Some Docusaurus sites put the `docs` folder outside of `website` (most likely former Docusaurus v1 sites):
|
||||
|
||||
```bash
|
||||
repo # git root
|
||||
├── docs # md files
|
||||
└── website # docusaurus root
|
||||
```
|
||||
|
||||
If you decide to use the `website` folder as Netlify's base directory, Netlify will not trigger builds when you update the `docs` folder, and you need to configure a [custom `ignore` command](https://docs.netlify.com/configure-builds/common-configurations/ignore-builds/):
|
||||
|
||||
```toml title="website/netlify.toml"
|
||||
[build]
|
||||
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../docs/"
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
:::warning
|
||||
|
||||
By default, Netlify adds trailing slashes to Docusaurus URLs.
|
||||
|
||||
It is recommended to disable the Netlify setting `Post Processing > Asset Optimization > Pretty Urls` to prevent lowercased URLs, unnecessary redirects, and 404 errors.
|
||||
|
||||
**Be very careful**: the `Disable asset optimization` global checkbox is broken and does not really disable the `Pretty URLs` setting in practice. Please make sure to **uncheck it independently**.
|
||||
|
||||
If you want to keep the `Pretty Urls` Netlify setting on, adjust the `trailingSlash` Docusaurus config appropriately.
|
||||
|
||||
Refer to [slorber/trailing-slash-guide](https://github.com/slorber/trailing-slash-guide) for more information.
|
||||
|
||||
:::
|
||||
|
||||
## Deploying to Vercel {#deploying-to-vercel}
|
||||
|
||||
Deploying your Docusaurus project to [Vercel](https://vercel.com/) will provide you with [various benefits](https://vercel.com/) in the areas of performance and ease of use.
|
||||
|
||||
To deploy your Docusaurus project with a [Vercel for Git Integration](https://vercel.com/docs/git-integrations), make sure it has been pushed to a Git repository.
|
||||
|
||||
Import the project into Vercel using the [Import Flow](https://vercel.com/import/git). During the import, you will find all relevant options preconfigured for you; however, you can choose to change any of these options, a list of which can be found [here](https://vercel.com/docs/build-step#build-&-development-settings).
|
||||
|
||||
After your project has been imported, all subsequent pushes to branches will generate [Preview Deployments](https://vercel.com/docs/platform/deployments#preview), and all changes made to the [Production Branch](https://vercel.com/docs/git-integrations#production-branch) (usually "main" or "master") will result in a [Production Deployment](https://vercel.com/docs/platform/deployments#production).
|
||||
|
||||
## Deploying to GitHub Pages {#deploying-to-github-pages}
|
||||
|
||||
Docusaurus provides an easy way to publish to [GitHub Pages](https://pages.github.com/), which comes for free with every GitHub repository.
|
||||
|
||||
### Overview {#github-pages-overview}
|
||||
|
||||
Usually, there are two repositories (at least, two branches) involved in a publishing process: the branch containing the source files, and the branch containing the build output to be served with GitHub Pages. In the following tutorial they will be referred to as **"source"** and **"deployment"**, respectively.
|
||||
|
||||
Each GitHub repository is associated with a GitHub Pages service. If the deployment repository is called `my-org/my-project` (where `my-org` is the organization name or username), the deployed site will appear at `https://my-org.github.io/my-project/`. Specially, if the deployment repository is called `my-org/my-org.github.io` (the _organization GitHub Pages repo_), the site will appear at `https://my-org.github.io/`.
|
||||
|
||||
:::info
|
||||
|
||||
In case you want to use your custom domain for GitHub Pages, create a `CNAME` file in the `static` directory. Anything within the `static` directory will be copied to the root of the `build` directory for deployment. When using a custom domain, you should be able to move back from `baseUrl: '/projectName/'` to `baseUrl: '/'`, and also set your `url` to your custom domain.
|
||||
|
||||
You may refer to GitHub Pages' documentation [User, Organization, and Project Pages](https://help.github.com/en/articles/user-organization-and-project-pages) for more details.
|
||||
|
||||
:::
|
||||
|
||||
GitHub Pages picks up deploy-ready files (the output from `docusaurus build`) from the default branch (`master` / `main`, usually) or the `gh-pages` branch, and either from the root or the `/docs` folder. You can configure that through `Settings > Pages` in your repository. This branch will be called the "deployment branch".
|
||||
|
||||
We provide a `docusaurus deploy` command that helps you deploy your site from the source branch to the deployment branch in one command: clone, build, and commit.
|
||||
|
||||
### `docusaurus.config.js` settings {#docusaurusconfigjs-settings}
|
||||
|
||||
First, modify your `docusaurus.config.js` and add the following params:
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| `organizationName` | The GitHub user or organization that owns the deployment repository. |
|
||||
| `projectName` | The name of the deployment repository. |
|
||||
| `deploymentBranch` | The name of deployment branch. Defaults to `'gh-pages'` for non-organization GitHub Pages repos (`projectName` not ending in `.github.io`). Otherwise, this needs to be explicit as a config field or environment variable. |
|
||||
|
||||
These fields also have their environment variable counterparts, which have a higher priority: `ORGANIZATION_NAME`, `PROJECT_NAME`, and `DEPLOYMENT_BRANCH`.
|
||||
|
||||
:::caution
|
||||
|
||||
GitHub Pages adds a trailing slash to Docusaurus URLs by default. It is recommended to set a `trailingSlash` config (`true` or `false`, not `undefined`).
|
||||
|
||||
:::
|
||||
|
||||
Example:
|
||||
|
||||
```jsx {3-6} title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
// ...
|
||||
url: 'https://endiliey.github.io', // Your website URL
|
||||
baseUrl: '/',
|
||||
projectName: 'endiliey.github.io',
|
||||
organizationName: 'endiliey',
|
||||
trailingSlash: false,
|
||||
// ...
|
||||
};
|
||||
```
|
||||
|
||||
:::warning
|
||||
|
||||
By default, GitHub Pages runs published files through [Jekyll](https://jekyllrb.com/). Since Jekyll will discard any files that begin with `_`, it is recommended that you disable Jekyll by adding an empty file named `.nojekyll` file to your `static` directory.
|
||||
|
||||
:::
|
||||
|
||||
### Environment settings {#environment-settings}
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| `USE_SSH` | Set to `true` to use SSH instead of the default HTTPS for the connection to the GitHub repo. If the source repo URL is an SSH URL (e.g. `git@github.com:facebook/docusaurus.git`), `USE_SSH` is inferred to be `true`. |
|
||||
| `GIT_USER` | The username for a GitHub account that **has push access to the deployment repo**. For your own repositories, this will usually be your GitHub username. Required if not using SSH, and ignored otherwise. |
|
||||
| `GIT_PASS` | Personal access token of the git user (specified by `GIT_USER`), to facilitate non-interactive deployment (e.g. continuous deployment) |
|
||||
| `CURRENT_BRANCH` | The source branch. Usually, the branch will be `main` or `master`, but it could be any branch except for `gh-pages`. If nothing is set for this variable, then the current branch from which `docusaurus deploy` is invoked will be used. |
|
||||
|
||||
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
||||
|
||||
| Name | Description |
|
||||
| ------------- | ----------------------------------------------- |
|
||||
| `GITHUB_HOST` | The domain name of your GitHub enterprise site. |
|
||||
| `GITHUB_PORT` | The port of your GitHub enterprise site. |
|
||||
|
||||
### Deploy {#deploy}
|
||||
|
||||
Finally, to deploy your site to GitHub Pages, run:
|
||||
|
||||
````mdx-code-block
|
||||
<Tabs>
|
||||
<TabItem value="bash" label="Bash">
|
||||
|
||||
```bash
|
||||
GIT_USER=<GITHUB_USERNAME> yarn deploy
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="windows" label="Windows">
|
||||
|
||||
```batch
|
||||
cmd /C "set "GIT_USER=<GITHUB_USERNAME>" && yarn deploy"
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="powershell" label="PowerShell">
|
||||
|
||||
```powershell
|
||||
cmd /C 'set "GIT_USER=<GITHUB_USERNAME>" && yarn deploy'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
````
|
||||
|
||||
:::caution
|
||||
|
||||
Beginning in August 2021, GitHub requires every command-line sign-in to use the **personal access token** instead of the password. When GitHub prompts for your password, enter the PAT instead. See the [GitHub documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information.
|
||||
|
||||
Alternatively, you can use SSH (`USE_SSH=true`) to login.
|
||||
|
||||
:::
|
||||
|
||||
### Triggering deployment with GitHub Actions {#triggering-deployment-with-github-actions}
|
||||
|
||||
[GitHub Actions](https://help.github.com/en/actions) allow you to automate, customize, and execute your software development workflows right in your repository.
|
||||
|
||||
The workflow examples below assume your website source resides in the `main` branch of your repository (the _source branch_ is `main`), under a folder called `website/`, and your [publishing source](https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) is configured for the `gh-pages` branch (the _deployment branch_ is `gh-pages`).
|
||||
|
||||
Our goal is that:
|
||||
|
||||
1. When a new pull request is made to `main` and updates `website/`, there's an action that ensures the site builds successfully, without actually deploying. This job will be called `test-deploy`.
|
||||
2. When a pull request is merged to the `main` branch or someone pushes to the `main` branch directly and `website/` is updated, it will be built and deployed to the `gh-pages` branch. After that, the new built output will be served on the GitHub Pages site. This job will be called `deploy`.
|
||||
|
||||
Here are two approaches to deploying your docs with GitHub Actions. Based on the location of your deployment branch (`gh-pages`), choose the relevant tab below:
|
||||
|
||||
- Source repo and deployment repo are the **same** repository.
|
||||
- The deployment repo is a **remote** repository, different from the source.
|
||||
|
||||
````mdx-code-block
|
||||
<Tabs>
|
||||
<TabItem value="same" label="Same">
|
||||
|
||||
While you can have both jobs defined in the same workflow file, the `deploy` job will always be listed as skipped in the PR check suite status. That's added noise providing no value to the review process, and as you cannot easily share common snippets, it is better to manage them as separate workflows instead.
|
||||
|
||||
We will use a popular third-party deployment action: [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus).
|
||||
|
||||
<details>
|
||||
|
||||
<summary>GitHub action files</summary>
|
||||
|
||||
Add these two workflow files:
|
||||
|
||||
:::warning
|
||||
|
||||
These files assume you are using yarn. If you use npm, change `cache: yarn`, `yarn install --frozen-lockfile`, `yarn build` to `cache: npm`, `npm ci`, `npm run build` accordingly.
|
||||
|
||||
:::
|
||||
|
||||
```yml title=".github/workflows/deploy.yml"
|
||||
name: Deploy to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: [website/**]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to GitHub Pages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
cache: yarn
|
||||
- name: Build website
|
||||
working-directory: website
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn build
|
||||
|
||||
# Popular action to deploy to GitHub Pages:
|
||||
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Build output to publish to the `gh-pages` branch:
|
||||
publish_dir: ./website/build
|
||||
# Assign commit authorship to the official GH-Actions bot for deploys to `gh-pages` branch:
|
||||
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
|
||||
# The GH actions bot is used by default if you didn't specify the two fields.
|
||||
# You can swap them out with your own user credentials.
|
||||
user_name: github-actions[bot]
|
||||
user_email: 41898282+github-actions[bot]@users.noreply.github.com
|
||||
```
|
||||
|
||||
```yml title=".github/workflows/test-deploy.yml"
|
||||
name: Test deployment
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths: [website/**]
|
||||
|
||||
jobs:
|
||||
test-deploy:
|
||||
name: Test deployment
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
cache: yarn
|
||||
- name: Test build
|
||||
working-directory: website
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn build
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="remote" label="Remote">
|
||||
|
||||
A cross-repo publish is more difficult to set up, because you need to push to another repo with permission checks. We will be using SSH to do the authentication.
|
||||
|
||||
1. Generate a new [SSH key](https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
|
||||
2. By default, your public key should have been created in `~/.ssh/id_rsa.pub`; otherwise, use the name you've provided in the previous step to add your key to [GitHub deploy keys](https://developer.github.com/v3/guides/managing-deploy-keys/).
|
||||
3. Copy the key to clipboard with `xclip -sel clip < ~/.ssh/id_rsa.pub` and paste it as a [deploy key](https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys) in your repository. Copy the file content if the command line doesn't work for you. Check the box for `Allow write access` before saving your deployment key.
|
||||
4. You'll need your private key as a [GitHub secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) to allow Docusaurus to run the deployment for you.
|
||||
5. Copy your private key with `xclip -sel clip < ~/.ssh/id_rsa` and paste a GitHub secret with the name `GH_PAGES_DEPLOY`. Copy the file content if the command line doesn't work for you. Save your secret.
|
||||
6. Create your [documentation workflow file](https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#creating-a-workflow-file) in `.github/workflows/`. In this example it's `deploy.yml`.
|
||||
|
||||
<details>
|
||||
|
||||
<summary>GitHub action file</summary>
|
||||
|
||||
:::warning
|
||||
|
||||
Please make sure that you replace `actions@github.com` with your GitHub email and `gh-actions` with your name.
|
||||
|
||||
This file assumes you are using yarn. If you use npm, change `cache: yarn`, `yarn install --frozen-lockfile`, `yarn build` to `cache: npm`, `npm ci`, `npm run build` accordingly.
|
||||
|
||||
:::
|
||||
|
||||
```yml title=".github/workflows/deploy.yml"
|
||||
name: Deploy to GitHub Pages
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test-deploy:
|
||||
if: github.event_name != 'push'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
cache: yarn
|
||||
- name: Test deployment
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn build
|
||||
deploy:
|
||||
if: github.event_name != 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
cache: yarn
|
||||
- uses: webfactory/ssh-agent@v0.5.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
|
||||
- name: Deploy to GitHub Pages
|
||||
env:
|
||||
USE_SSH: true
|
||||
run: |
|
||||
git config --global user.email "actions@github.com"
|
||||
git config --global user.name "gh-actions"
|
||||
yarn install --frozen-lockfile
|
||||
yarn deploy
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
````
|
||||
|
||||
### Triggering deployment with Travis CI {#triggering-deployment-with-travis-ci}
|
||||
|
||||
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the `yarn deploy` script whenever your website is updated. The following section covers how to do just that using [Travis CI](https://travis-ci.com/), a popular continuous integration service provider.
|
||||
|
||||
1. Go to https://github.com/settings/tokens and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). When creating the token, grant it the `repo` scope so that it has the permissions it needs.
|
||||
2. Using your GitHub account, [add the Travis CI app](https://github.com/marketplace/travis-ci) to the repository you want to activate.
|
||||
3. Open your Travis CI dashboard. The URL looks like `https://travis-ci.com/USERNAME/REPO`, and navigate to the `More options > Setting > Environment Variables` section of your repository.
|
||||
4. Create a new environment variable named `GH_TOKEN` with your newly generated token as its value, then `GH_EMAIL` (your email address) and `GH_NAME` (your GitHub username).
|
||||
5. Create a `.travis.yml` on the root of your repository with the following:
|
||||
|
||||
```yml title=".travis.yml"
|
||||
language: node_js
|
||||
node_js:
|
||||
- '14.15.0'
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
cache:
|
||||
yarn: true
|
||||
script:
|
||||
- git config --global user.name "${GH_NAME}"
|
||||
- git config --global user.email "${GH_EMAIL}"
|
||||
- echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
|
||||
- yarn install
|
||||
- GIT_USER="${GH_NAME}" yarn deploy
|
||||
```
|
||||
|
||||
Now, whenever a new commit lands in `main`, Travis CI will run your suite of tests and if everything passes, your website will be deployed via the `yarn deploy` script.
|
||||
|
||||
### Triggering deployment with Buddy {#triggering-deployment-with-buddy}
|
||||
|
||||
[Buddy](https://buddy.works/) is an easy-to-use CI/CD tool that allows you to automate the deployment of your portal to different environments, including GitHub Pages.
|
||||
|
||||
Follow these steps to create a pipeline that automatically deploys a new version of your website whenever you push changes to the selected branch of your project:
|
||||
|
||||
1. Go to https://github.com/settings/tokens and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). When creating the token, grant it the `repo` scope so that it has the permissions it needs.
|
||||
2. Sign in to your Buddy account and create a new project.
|
||||
3. Choose GitHub as your git hosting provider and select the repository with the code of your website.
|
||||
4. Using the left navigation panel, switch to the `Pipelines` view.
|
||||
5. Create a new pipeline. Define its name, set the trigger mode to `On push`, and select the branch that triggers the pipeline execution.
|
||||
6. Add a `Node.js` action.
|
||||
7. Add these commands in the action's terminal:
|
||||
|
||||
```bash
|
||||
GIT_USER=<GH_PERSONAL_ACCESS_TOKEN>
|
||||
git config --global user.email "<YOUR_GH_EMAIL>"
|
||||
git config --global user.name "<YOUR_GH_USERNAME>"
|
||||
yarn deploy
|
||||
```
|
||||
|
||||
After creating this simple pipeline, each new commit pushed to the branch you selected deploys your website to GitHub Pages using `yarn deploy`. Read [this guide](https://buddy.works/guides/react-docusaurus) to learn more about setting up a CI/CD pipeline for Docusaurus.
|
||||
|
||||
### Using Azure Pipelines {#using-azure-pipelines}
|
||||
|
||||
1. Sign Up at [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) if you haven't already.
|
||||
2. Create an organization and within the organization create a project and connect your repository from GitHub.
|
||||
3. Go to https://github.com/settings/tokens and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) with the `repo` scope.
|
||||
4. In the project page (which looks like `https://dev.azure.com/ORG_NAME/REPO_NAME/_build` create a new pipeline with the following text. Also, click on edit and add a new environment variable named `GH_TOKEN` with your newly generated token as its value, then `GH_EMAIL` (your email address) and `GH_NAME` (your GitHub username). Make sure to mark them as secret. Alternatively, you can also add a file named `azure-pipelines.yml` at your repository root.
|
||||
|
||||
```yml title="azure-pipelines.yml"
|
||||
trigger:
|
||||
- main
|
||||
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
persistCredentials: true
|
||||
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: 14.x
|
||||
displayName: Install Node.js
|
||||
|
||||
- script: |
|
||||
git config --global user.name "${GH_NAME}"
|
||||
git config --global user.email "${GH_EMAIL}"
|
||||
git checkout -b main
|
||||
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
|
||||
yarn install
|
||||
GIT_USER="${GH_NAME}" yarn deploy
|
||||
env:
|
||||
GH_NAME: $(GH_NAME)
|
||||
GH_EMAIL: $(GH_EMAIL)
|
||||
GH_TOKEN: $(GH_TOKEN)
|
||||
displayName: Install and build
|
||||
```
|
||||
|
||||
### Using Drone {#using-drone}
|
||||
|
||||
1. Create a new ssh key that will be the [deploy key](https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys) for your project.
|
||||
2. Name your private and public keys to be specific and so that it does not overwrite your other [ssh keys](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
|
||||
3. Go to `https://github.com/USERNAME/REPO/settings/keys` and add a new deploy key by pasting in our public key you just generated.
|
||||
4. Open your Drone.io dashboard and login. The URL looks like `https://cloud.drone.io/USERNAME/REPO`.
|
||||
5. Click on the repository, click on activate repository, and add a secret called `git_deploy_private_key` with your private key value that you just generated.
|
||||
6. Create a `.drone.yml` on the root of your repository with below text.
|
||||
|
||||
```yml title=".drone.yml"
|
||||
kind: pipeline
|
||||
type: docker
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
- name: Website
|
||||
image: node
|
||||
commands:
|
||||
- mkdir -p $HOME/.ssh
|
||||
- ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
|
||||
- echo "$GITHUB_PRIVATE_KEY" > "$HOME/.ssh/id_rsa"
|
||||
- chmod 0600 $HOME/.ssh/id_rsa
|
||||
- cd website
|
||||
- yarn install
|
||||
- yarn deploy
|
||||
environment:
|
||||
USE_SSH: true
|
||||
GITHUB_PRIVATE_KEY:
|
||||
from_secret: git_deploy_private_key
|
||||
```
|
||||
|
||||
Now, whenever you push a new tag to GitHub, this trigger will start the drone CI job to publish your website.
|
||||
|
||||
## Deploying to Render {#deploying-to-render}
|
||||
|
||||
[Render](https://render.com) offers [free static site hosting](https://render.com/docs/static-sites) with fully managed SSL, custom domains, a global CDN and continuous auto-deploy from your Git repo. Get started in just a few minutes by following [Render's guide to deploying Docusaurus](https://render.com/docs/deploy-docusaurus).
|
||||
|
||||
## Deploying to Qovery {#deploying-to-qovery}
|
||||
|
||||
[Qovery](https://www.qovery.com) is a fully-managed cloud platform that runs on your AWS, Digital Ocean and Scaleway account where you can host static sites, backend APIs, databases, cron jobs, and all your other apps in one place.
|
||||
|
||||
1. Create a Qovery account. Visit the [Qovery dashboard](https://console.qovery.com) to create an account if you don't already have one.
|
||||
2. Create a project.
|
||||
- Click on **Create project** and give a name to your project.
|
||||
- Click on **Next**.
|
||||
3. Create a new environment.
|
||||
- Click on **Create environment** and give a name (e.g. staging, production).
|
||||
4. Add an application.
|
||||
- Click on **Create an application**, give a name and select your GitHub or GitLab repository where your Docusaurus app is located.
|
||||
- Define the main branch name and the root application path.
|
||||
- Click on **Create**. After the application is created:
|
||||
- Navigate to your application **Settings**
|
||||
- Select **Port**
|
||||
- Add port used by your Docusaurus application
|
||||
5. Deploy All you have to do now is to navigate to your application and click on **Deploy**.
|
||||
|
||||

|
||||
|
||||
That's it. Watch the status and wait till the app is deployed. To open the application in your browser, click on **Action** and **Open** in your application overview.
|
||||
|
||||
## Deploying to Hostman {#deploying-to-hostman}
|
||||
|
||||
[Hostman](https://hostman.com/) allows you to host static websites for free. Hostman automates everything, you just need to connect your repository and follow easy steps:
|
||||
|
||||
1. Create a service.
|
||||
|
||||
To deploy a Docusaurus static website, click **Create** in the top-left corner of your [Dashboard](https://dashboard.hostman.com/) and choose **Front-end app or static website**.
|
||||
|
||||
2. Select the project to deploy.
|
||||
|
||||
If you are logged in to Hostman with your GitHub, GitLab or Bitbucket account, at this point you will see the repository with your projects, including the private ones.
|
||||
|
||||
Choose the project you want to deploy. It must contain the directory with the project’s files (usually it is website or my-website).
|
||||
|
||||
To access a different repository, click **Connect another repository**.
|
||||
|
||||
If you didn’t use your Git account credentials to log in, you’ll be able to access the necessary account now, and then select the project.
|
||||
|
||||
3. Configure the build settings.
|
||||
|
||||
Next, the **Website customization** window will appear. Choose the **Static website** option from the list of frameworks.
|
||||
|
||||
The **Directory with app** points at the directory that will contain the project's files after the build. You can leave it empty if during Step 2 you selected the repository with the contents of the website (or `my_website`) directory.
|
||||
|
||||
The standard build command for Docusaurus will be:
|
||||
|
||||
```bash npm2yarn
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can modify the build command if needed. You can enter multiple commands separated by `&&`.
|
||||
|
||||
4. Deploy.
|
||||
|
||||
Click **Deploy** to start the build process.
|
||||
|
||||
Once it starts, you will enter the deployment log. If there are any issues with the code, you will get warning or error messages in the log, specifying the cause of the problem. Usually, the log contains all the debugging data you'll need.
|
||||
|
||||
When the deployment is complete, you will receive an email notification and also see a log entry. All done! Your project is up and ready.
|
||||
|
||||
## Deploying to Surge {#deploying-to-surge}
|
||||
|
||||
Surge is a [static web hosting platform](https://surge.sh/help/getting-started-with-surge), it is used to deploy your Docusaurus project from the command line in a minute. Deploying your project to Surge is easy and it is also free (including a custom domain and SSL).
|
||||
|
||||
Deploy your app in a matter of seconds using surge with the following steps:
|
||||
|
||||
1. First, install Surge using npm by running the following command:
|
||||
```bash npm2yarn
|
||||
npm install -g surge
|
||||
```
|
||||
2. To build the static files of your site for production in the root directory of your project, run:
|
||||
```bash npm2yarn
|
||||
npm run build
|
||||
```
|
||||
3. Then, run this command inside the root directory of your project:
|
||||
```bash
|
||||
surge build/
|
||||
```
|
||||
|
||||
First-time users of Surge would be prompted to create an account from the command line(happens only once).
|
||||
|
||||
Confirm that the site you want to publish is in the `build` directory, a randomly generated subdomain `*.surge.sh subdomain` is always given (which can be edited).
|
||||
|
||||
### Using your domain {#using-your-domain}
|
||||
|
||||
If you have a domain name you can deploy your site using surge to your domain using the command:
|
||||
|
||||
```bash
|
||||
surge build/ yourdomain.com
|
||||
```
|
||||
|
||||
Your site is now deployed for free at `subdomain.surge.sh` or `yourdomain.com` depending on the method you chose.
|
||||
|
||||
### Setting up CNAME file {#setting-up-cname-file}
|
||||
|
||||
Store your domain in a CNAME file for future deployments with the following command:
|
||||
|
||||
```bash
|
||||
echo subdomain.surge.sh > CNAME
|
||||
```
|
||||
|
||||
You can deploy any other changes in the future with the command `surge`.
|
||||
|
||||
## Deploying to QuantCDN {#deploying-to-quantcdn}
|
||||
|
||||
1. Install [Quant CLI](https://docs.quantcdn.io/docs/cli/get-started)
|
||||
2. Create a QuantCDN account by [signing up](https://dashboard.quantcdn.io/register)
|
||||
3. Initialize your project with `quant init` and fill in your credentials:
|
||||
```bash
|
||||
quant init
|
||||
```
|
||||
4. Deploy your site.
|
||||
```bash
|
||||
quant deploy
|
||||
```
|
||||
|
||||
See [docs](https://docs.quantcdn.io/docs/cli/continuous-integration) and [blog](https://www.quantcdn.io/blog) for more examples and use cases for deploying to QuantCDN.
|
|
@ -8,6 +8,55 @@ Docusaurus provides some APIs on the clients that can be helpful to you when bui
|
|||
|
||||
## Components {#components}
|
||||
|
||||
### `<ErrorBoundary />` {#errorboundary}
|
||||
|
||||
This component creates a [React error boundary](https://reactjs.org/docs/error-boundaries.html).
|
||||
|
||||
Use it to wrap components that might throw, and display a fallback when that happens instead of crashing the whole app.
|
||||
|
||||
```jsx
|
||||
import React from 'react';
|
||||
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
||||
|
||||
const SafeComponent = () => (
|
||||
<ErrorBoundary
|
||||
fallback={({error, tryAgain}) => (
|
||||
<div>
|
||||
<p>This component crashed because of error: {error.message}.</p>
|
||||
<button onClick={tryAgain}>Try Again!</button>
|
||||
</div>
|
||||
)}>
|
||||
<SomeDangerousComponentThatMayThrow />
|
||||
</ErrorBoundary>
|
||||
);
|
||||
```
|
||||
|
||||
```mdx-code-block
|
||||
import ErrorBoundaryTestButton from "@site/src/components/ErrorBoundaryTestButton"
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
To see it in action, click here: <ErrorBoundaryTestButton/>
|
||||
|
||||
:::
|
||||
|
||||
:::info
|
||||
|
||||
Docusaurus uses this component to catch errors within the theme's layout, and also within the entire app.
|
||||
|
||||
:::
|
||||
|
||||
:::note
|
||||
|
||||
This component doesn't catch build-time errors, and only protects against client-side render errors that can happen when using stateful React components.
|
||||
|
||||
:::
|
||||
|
||||
#### Props {#errorboundary-props}
|
||||
|
||||
- `fallback`: an optional callback returning a JSX element. It will receive two props: `error`, the error that was caught, and `tryAgain`, a function (`() => void`) callback to reset the error in the component and try rendering it again.
|
||||
|
||||
### `<Head/>` {#head}
|
||||
|
||||
This reusable React component will manage all of your changes to the document head. It takes plain HTML tags and outputs plain HTML tags and is beginner-friendly. It is a wrapper around [React Helmet](https://github.com/nfl/react-helmet).
|
|
@ -112,7 +112,7 @@ tags:
|
|||
|
||||
:::tip
|
||||
|
||||
Tags can also be declared with `tags [Demo, Getting started]`
|
||||
Tags can also be declared with `tags: [Demo, Getting started]`.
|
||||
|
||||
Read more about all the possible [Yaml array syntaxes](https://www.w3schools.io/file/yaml-arrays/).
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
id: sidebar
|
||||
title: Sidebar
|
||||
toc_max_heading_level: 4
|
||||
toc_max_heading_level: 5
|
||||
slug: /sidebar
|
||||
---
|
||||
|
||||
|
@ -290,6 +290,7 @@ type SidebarItemCategory = {
|
|||
// Category options:
|
||||
collapsible: boolean; // Set the category to be collapsible
|
||||
collapsed: boolean; // Set the category to be initially collapsed or open by default
|
||||
link: SidebarItemCategoryLinkDoc | SidebarItemCategoryLinkGeneratedIndex;
|
||||
};
|
||||
```
|
||||
|
||||
|
@ -335,6 +336,69 @@ module.exports = {
|
|||
|
||||
:::
|
||||
|
||||
#### Category links {#category-link}
|
||||
|
||||
With category links, clicking on a category can navigate you to another page.
|
||||
|
||||
:::tip
|
||||
|
||||
Use category links to introduce a category of documents.
|
||||
|
||||
:::
|
||||
|
||||
##### Doc link {#category-doc-link}
|
||||
|
||||
A category can link to an existing document.
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
docs: [
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Guides',
|
||||
// highlight-start
|
||||
link: {type: 'doc', id: 'introduction'},
|
||||
// highlight-end
|
||||
items: ['pages', 'docs', 'blog', 'search'],
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
See it in action in the [i18n introduction page](../../i18n/i18n-introduction.md).
|
||||
|
||||
##### Generated index page {#generated-index-page}
|
||||
|
||||
You can auto-generate an index page that displays all the direct children of this category. The `slug` allows you to customize the generated page's route, which defaults to `/category/{{category name}}`.
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
docs: [
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Guides',
|
||||
// highlight-start
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
title: 'Docusaurus Guides',
|
||||
description: 'Learn about the most important Docusaurus concepts!',
|
||||
slug: '/category/docusaurus-guides',
|
||||
},
|
||||
// highlight-end
|
||||
items: ['pages', 'docs', 'blog', 'search'],
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
See it in action in the [Docusaurus Guides pages](/docs/next/category/guides).
|
||||
|
||||
:::tip
|
||||
|
||||
Use `generated-index` links as a quick way to get an introductory document.
|
||||
|
||||
:::
|
||||
|
||||
#### Collapsible categories {#collapsible-categories}
|
||||
|
||||
We support the option to expand/collapse categories. Categories are collapsible by default, but you can disable collapsing with `collapsible: false`.
|
||||
|
@ -499,13 +563,46 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
#### Autogenerated sidebar metadatas {#autogenerated-sidebar-metadatas}
|
||||
#### Category index convention {#category-index-convention}
|
||||
|
||||
Docusaurus can automatically link a category to its index document.
|
||||
|
||||
A category index document is a document following one of those filename conventions:
|
||||
|
||||
- Named as `index` (case-insensitive): `docs/Guides/index.md`
|
||||
- Named as `README` (case-insensitive): `docs/Guides/README.mdx`
|
||||
- Same name as parent folder: `docs/Guides/Guides.md`
|
||||
|
||||
This is equivalent to using a category with a [doc link](#category-doc-link):
|
||||
|
||||
```js title="sidebars.js"
|
||||
module.exports = {
|
||||
docs: [
|
||||
// highlight-start
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Guides',
|
||||
link: {type: 'doc', id: 'Guides/index'},
|
||||
items: [],
|
||||
},
|
||||
// highlight-end
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
Naming your introductory document `README.md` makes it show up when browsing the folder using the GitHub interface, while using `index.md` makes the behavior more in line with how HTML files are served.
|
||||
|
||||
:::
|
||||
|
||||
#### Autogenerated sidebar metadata {#autogenerated-sidebar-metadata}
|
||||
|
||||
By default, the sidebar slice will be generated in **alphabetical order** (using files and folders names).
|
||||
|
||||
If the generated sidebar does not look good, you can assign additional metadatas to docs and categories.
|
||||
If the generated sidebar does not look good, you can assign additional metadata to docs and categories.
|
||||
|
||||
**For docs**: use additional frontmatter:
|
||||
**For docs**: use additional front matter:
|
||||
|
||||
```md title="docs/tutorials/tutorial-easy.md" {1-4}
|
||||
---
|
||||
|
@ -524,10 +621,22 @@ This is the easy tutorial!
|
|||
{
|
||||
"label": "Tutorial",
|
||||
"position": 3,
|
||||
"className": "red"
|
||||
"className": "red",
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"title": "Tutorial overview"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
:::info
|
||||
|
||||
If the `link` is explicitly specified, Docusaurus will not apply any [default conventions](#category-index-convention).
|
||||
|
||||
The doc links can be specified relatively, e.g. if the category is generated with the `guides` directory, `"link": {"type": "doc", "id": "intro"}` will be resolved to the ID `guides/intro`, only falling back to `intro` if a doc with the former ID doesn't exist.
|
||||
|
||||
:::
|
||||
|
||||
```yaml title="docs/tutorials/_category_.yml"
|
||||
label: 'Tutorial'
|
||||
position: 2.5 # float position is supported
|
||||
|
@ -566,7 +675,7 @@ By default, Docusaurus will **remove the number prefix** from the doc id, title,
|
|||
|
||||
:::caution
|
||||
|
||||
**Prefer using [additional metadatas](#autogenerated-sidebar-metadatas)**.
|
||||
**Prefer using [additional metadata](#autogenerated-sidebar-metadata)**.
|
||||
|
||||
Updating a number prefix can be annoying, as it can require **updating multiple existing markdown links**:
|
||||
|
|
@ -184,7 +184,7 @@ Should you cut a new documentation version 1.0.1? **You probably shouldn't**. 1.
|
|||
|
||||
### Keep the number of versions small {#keep-the-number-of-versions-small}
|
||||
|
||||
As a good rule of thumb, try to keep the number of your versions below 10. **It is very likely** that you will have a lot of obsolete versioned documentation that nobody even reads anymore. For example, [Jest](https://jestjs.io/versions) is currently in version `24.9`, and only maintains several latest documentation version with the lowest being `22.X`. Keep it small 😊
|
||||
As a good rule of thumb, try to keep the number of your versions below 10. **It is very likely** that you will have a lot of obsolete versioned documentation that nobody even reads anymore. For example, [Jest](https://jestjs.io/versions) is currently in version `24.9`, and only maintains several latest documentation versions with the lowest being `22.X`. Keep it small 😊
|
||||
|
||||
### Use absolute import within the docs {#use-absolute-import-within-the-docs}
|
||||
|
|
@ -5,9 +5,7 @@ description: Handling assets in Docusaurus Markdown
|
|||
slug: /markdown-features/assets
|
||||
---
|
||||
|
||||
Sometimes you want to link to static assets directly from Markdown files, and it is convenient to co-locate the asset next to the Markdown file using it.
|
||||
|
||||
We have setup Webpack loaders to handle most common file types, so that when you import a file, you get its url, and the asset is automatically copied to the output folder.
|
||||
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.
|
||||
|
||||
Let's imagine the following file structure:
|
||||
|
||||
|
@ -145,3 +143,16 @@ import ThemedImage from '@theme/ThemedImage';
|
|||
}}
|
||||
/>
|
||||
```
|
||||
|
||||
## Static assets {#static-assets}
|
||||
|
||||
If a Markdown link or image has an absolute path, the path will be seen as a file path and will be resolved from the static directories. For example, if you have configured [static directories](../../static-assets.md) to be `['public', 'static']`, then for the following image:
|
||||
|
||||
```md title="my-doc.md"
|
||||

|
||||
```
|
||||
|
||||
Docusaurus will try to look for it in both `static/img/docusaurus.png` and `public/img/docusaurus.png`. The link will then be converted to a `require` call instead of staying as a URL. This is desirable in two regards:
|
||||
|
||||
1. You don't have to worry about base URL, which Docusaurus will take care of when serving the asset;
|
||||
2. The image enters Webpack's build pipeline and its name will be appended by a hash, which enables browsers to aggressively cache the image and improves your site's performance.
|
|
@ -1,34 +1,34 @@
|
|||
---
|
||||
id: head-metadatas
|
||||
title: Head Metadatas
|
||||
description: Declaring page-specific head metadatas through MDX
|
||||
slug: /markdown-features/head-metadatas
|
||||
id: head-metadata
|
||||
title: Head Metadata
|
||||
description: Declaring page-specific head metadata through MDX
|
||||
slug: /markdown-features/head-metadata
|
||||
---
|
||||
|
||||
# Head Metadatas
|
||||
# Head Metadata
|
||||
|
||||
Docusaurus automatically sets useful page metadatas in `<html>`, `<head>` and `<body>` for you.
|
||||
Docusaurus automatically sets useful page metadata in `<html>`, `<head>` and `<body>` for you.
|
||||
|
||||
It is possible to add extra metadatas (or override existing ones) by using the `<head>` tag in Markdown files:
|
||||
It is possible to add extra metadata (or override existing ones) by using the `<head>` tag in Markdown files:
|
||||
|
||||
```md title="markdown-features-head-metadatas.mdx"
|
||||
```md title="markdown-features-head-metadata.mdx"
|
||||
---
|
||||
id: head-metadatas
|
||||
title: Head Metadatas
|
||||
id: head-metadata
|
||||
title: Head Metadata
|
||||
---
|
||||
|
||||
<!-- highlight-start -->
|
||||
<head>
|
||||
<html className="some-extra-html-class" />
|
||||
<body className="other-extra-body-class" />
|
||||
<title>Head Metadatas customized title!</title>
|
||||
<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-metadatas" />
|
||||
<link rel="canonical" href="https://docusaurus.io/docs/markdown-features/head-metadata" />
|
||||
</head>
|
||||
<!-- highlight-end -->
|
||||
|
||||
# Head Metadatas
|
||||
# Head Metadata
|
||||
|
||||
My text
|
||||
```
|
||||
|
@ -37,10 +37,10 @@ My text
|
|||
<head>
|
||||
<html className="some-extra-html-class" />
|
||||
<body className="other-extra-body-class" />
|
||||
<title>Head Metadatas customized title!</title>
|
||||
<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-metadatas" />
|
||||
<link rel="canonical" href="https://docusaurus.io/docs/markdown-features/head-metadata" />
|
||||
</head>
|
||||
```
|
||||
|
||||
|
@ -48,7 +48,7 @@ My text
|
|||
|
||||
This `<head>` declaration has been added to the current Markdown doc, as a demo.
|
||||
|
||||
Open your browser DevTools and check how this page's metadatas have been affected.
|
||||
Open your browser DevTools and check how this page's metadata have been affected.
|
||||
|
||||
:::
|
||||
|
|
@ -0,0 +1,198 @@
|
|||
---
|
||||
id: plugins
|
||||
title: MDX Plugins
|
||||
description: Using MDX plugins to expand Docusaurus Markdown functionalities
|
||||
slug: /markdown-features/plugins
|
||||
---
|
||||
|
||||
Sometimes, you may want to extend or tweak your Markdown syntax. For example:
|
||||
|
||||
- How do I embed youtube videos using the image syntax (``)?
|
||||
- How do I style links that are on its own line differently, e.g., like a social card?
|
||||
- How do I make every page start with a copyright notice?
|
||||
|
||||
And the answer is: create an MDX plugin! MDX has a built-in [plugin system](https://mdxjs.com/advanced/plugins/) that can be used to customize how the Markdown files will be parsed and transformed to JSX. There are three typical use-cases of MDX plugins:
|
||||
|
||||
- Using existing [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) or [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins);
|
||||
- Creating remark/rehype plugins to tranform the elements generated by existing MDX syntax;
|
||||
- Creating remark/rehype plugins to introduce new syntaxes to MDX.
|
||||
|
||||
If you play with the [MDX playground](https://mdx-git-renovate-babel-monorepo-mdx.vercel.app/playground), you would notice that the MDX transpilation has two intermediate steps: Markdown AST (MDAST), and Hypertext AST (HAST), before arriving at the final JSX output. MDX plugins also come in two forms:
|
||||
|
||||
- **[Remark](https://github.com/remarkjs/remark/)**: processes the Markdown AST.
|
||||
- **[Rehype](https://github.com/rehypejs/rehype/)**: processes the Hypertext AST.
|
||||
|
||||
:::tip
|
||||
|
||||
Use plugins to introduce shorter syntax for the most commonly used JSX elements in your project. The [admonition](./markdown-features-admonitions.mdx) syntax that we offer is also generated by a [Remark plugin](https://github.com/elviswolcott/remark-admonitions), and you could do the same for your own use-case.
|
||||
|
||||
:::
|
||||
|
||||
## Default plugins {#default-plugins}
|
||||
|
||||
Docusaurus injects [some default Remark plugins](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-mdx-loader/src/remark) during Markdown processing. These plugins would:
|
||||
|
||||
- Generate the table of contents;
|
||||
- Add anchor links to each heading;
|
||||
- Transform images and links to `require()` calls.
|
||||
- …
|
||||
|
||||
These are all typical use-cases of Remark plugins, which can also be a source of inspiration if you want to implement your own plugin.
|
||||
|
||||
## Installing plugins {#installing-plugins}
|
||||
|
||||
An MDX plugin is usually a npm package, so you install them like other npm packages using npm. Take the [math plugins](./markdown-features-math-equations.mdx) as example.
|
||||
|
||||
```bash npm2yarn
|
||||
npm install --save remark-math@3 rehype-katex@4
|
||||
```
|
||||
|
||||
:::note
|
||||
|
||||
There's recently a trend in the Remark/Rehype ecosystem to migrate to ES Modules, which Docusaurus doesn't support yet. Please make sure your installed plugin version is CommonJS-compatible before we officially support ESM.
|
||||
|
||||
:::
|
||||
|
||||
<details>
|
||||
<summary>How are <code>remark-math</code> and <code>rehype-katex</code> different?</summary>
|
||||
|
||||
In case you are wondering how Remark and Rehype are different, here is a good example. `remark-math` operates on the Markdown AST, where it sees text like `$...$`, and all it does is transforms that to the JSX `<span class="math math-inline">...</span>` without doing too much with the content. This decouples the extraction of math formulae from their rendering, which means you can swap $\KaTeX$ out with other math renderers, like MathJax (with [`rehype-mathjax`](https://github.com/remarkjs/remark-math/tree/main/packages/rehype-mathjax)), just by replacing the Rehype plugin.
|
||||
|
||||
Next, the `rehype-katex` operates on the Hypertext AST where everything has been converted to HTML-like tags already. It traverses all the elements with `math` class, and uses $\KaTeX$ to parse and render the content to actual HTML.
|
||||
|
||||
</details>
|
||||
|
||||
Next, add them to the plugin options through plugin or preset config in `docusaurus.config.js`:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
// highlight-start
|
||||
const math = require('remark-math');
|
||||
const katex = require('rehype-katex');
|
||||
// highlight-end
|
||||
|
||||
module.exports = {
|
||||
title: 'Docusaurus',
|
||||
tagline: 'Build optimized websites quickly, focus on your content',
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
// highlight-start
|
||||
remarkPlugins: [math],
|
||||
rehypePlugins: [katex],
|
||||
// highlight-end
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
## Configuring plugins {#configuring-plugins}
|
||||
|
||||
Some plugins can be configured and accept their own options. In that case, use the `[plugin, pluginOptions]` syntax, like this:
|
||||
|
||||
```jsx title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
remarkPlugins: [math],
|
||||
rehypePlugins: [
|
||||
// highlight-next-line
|
||||
[katex, {strict: false}],
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
You should check your plugin's documentation for options it supports.
|
||||
|
||||
## Creating new rehype/remark plugins
|
||||
|
||||
If there isn't an existing package that satisfies your customization need, you can create your own MDX plugin.
|
||||
|
||||
:::note
|
||||
|
||||
The writeup below is **not** meant to be a comprehensive guide to creating a plugin, but just an illustration of how to make it work with Docusaurus. Visit the [Remark](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#creating-plugins) or [Rehype](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#creating-plugins) documentation for a more in-depth explanation of how they work.
|
||||
|
||||
:::
|
||||
|
||||
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate NPM package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` which operates on the AST.
|
||||
|
||||
```js "src/remark/section-prefix.js"
|
||||
const visit = require('unist-util-visit');
|
||||
|
||||
const plugin = (options) => {
|
||||
const transformer = async (ast) => {
|
||||
let number = 1;
|
||||
visit(ast, 'heading', (node) => {
|
||||
if (node.depth === 2 && node.children.length > 0) {
|
||||
if (node.children[0].type === 'text') {
|
||||
node.children[0].value = `Section ${number}. ${node.children[0].value}`;
|
||||
} else {
|
||||
node.children.unshift({
|
||||
type: 'text',
|
||||
value: `Section ${number}. `,
|
||||
});
|
||||
}
|
||||
number++;
|
||||
}
|
||||
});
|
||||
};
|
||||
return transformer;
|
||||
};
|
||||
|
||||
module.exports = plugin;
|
||||
```
|
||||
|
||||
You can now import your plugin in `docusaurus.config.js` and use it just like an installed plugin!
|
||||
|
||||
```jsx title="docusaurus.config.js"
|
||||
// highlight-next-line
|
||||
const sectionPrefix = require('./src/remark/section-prefix');
|
||||
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
// highlight-next-line
|
||||
remarkPlugins: [sectionPrefix],
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
:::note
|
||||
|
||||
The default plugins of Docusaurus would operate before the custom remark plugins, and that means the images or links have been converted to JSX with `require()` calls already. For example, in the example above, the table of contents generated is still the same even when all `h2` headings are now prefixed by `Section X.`, because the TOC-generating plugin is called before our custom plugin. If you need to process the MDAST before the default plugins do, use the `beforeDefaultRemarkPlugins` and `beforeDefaultRehypePlugins`.
|
||||
|
||||
```jsx title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
// highlight-next-line
|
||||
beforeDefaultRemarkPlugins: [sectionPrefix],
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
This would make the table of contents generated contain the `Section X.` prefix as well.
|
||||
|
||||
:::
|
|
@ -5,6 +5,8 @@ description: Using the power of React in Docusaurus Markdown documents, thanks t
|
|||
slug: /markdown-features/react
|
||||
---
|
||||
|
||||
# MDX and React
|
||||
|
||||
```mdx-code-block
|
||||
import BrowserWindow from '@site/src/components/BrowserWindow';
|
||||
```
|
||||
|
@ -169,3 +171,48 @@ This way, you can reuse contents among multiple pages and avoid duplicating mate
|
|||
The table-of-contents does not currently contain the imported Markdown headings. This is a technical limitation that we are trying to solve ([issue](https://github.com/facebook/docusaurus/issues/3915)).
|
||||
|
||||
:::
|
||||
|
||||
## Available exports
|
||||
|
||||
Within the MDX page, the following variables are available as globals:
|
||||
|
||||
- `frontMatter`: the front matter as a record of string keys and values;
|
||||
- `toc`: the table of contents, as a tree of headings. See also [Inline TOC](./markdown-features-inline-toc.mdx) for a more concrete use-case.
|
||||
- `contentTitle`: the Markdown title, which is the first `h1` heading in the Markdown text. It's `undefined` if there isn't one (e.g. title specified in the front matter).
|
||||
|
||||
```jsx
|
||||
import TOCInline from '@theme/TOCInline';
|
||||
import CodeBlock from '@theme/CodeBlock';
|
||||
|
||||
The table of contents for this page, serialized:
|
||||
|
||||
<CodeBlock className="language-json">{JSON.stringify(toc, null, 2)}</CodeBlock>
|
||||
|
||||
The front matter of this page:
|
||||
|
||||
<ul>
|
||||
{Object.entries(frontMatter).map(([key, value]) => <li key={key}><b>{key}</b>: {value}</li>)}
|
||||
</ul>
|
||||
|
||||
<p>The title of this page is: <b>{contentTitle}</b></p>
|
||||
```
|
||||
|
||||
```mdx-code-block
|
||||
import TOCInline from '@theme/TOCInline';
|
||||
|
||||
<BrowserWindow>
|
||||
|
||||
The table of contents for this page, serialized:
|
||||
|
||||
<CodeBlock className="language-json">{JSON.stringify(toc, null, 2)}</CodeBlock>
|
||||
|
||||
The front matter of this page:
|
||||
|
||||
<ul>
|
||||
{Object.entries(frontMatter).map(([key, value]) => <li key={key}><b>{key}</b>: {value}</li>)}
|
||||
</ul>
|
||||
|
||||
<p>The title of this page is: <b>{contentTitle}</b></p>
|
||||
|
||||
</BrowserWindow>
|
||||
```
|
|
@ -15,7 +15,7 @@ Use **[docusaurus.new](https://docusaurus.new)** to test Docusaurus immediately
|
|||
|
||||
## Requirements {#requirements}
|
||||
|
||||
- [Node.js](https://nodejs.org/en/download/) version >= 12.13.0 or above (which can be checked by running `node -v`). You can use [nvm](https://github.com/nvm-sh/nvm) for managing multiple Node versions on a single machine installed
|
||||
- [Node.js](https://nodejs.org/en/download/) version >= 14 or above (which can be checked by running `node -v`). You can use [nvm](https://github.com/nvm-sh/nvm) for managing multiple Node versions on a single machine installed
|
||||
- [Yarn](https://yarnpkg.com/en/) version >= 1.5 (which can be checked by running `yarn --version`). Yarn is a performant package manager for JavaScript and replaces the `npm` client. It is not strictly necessary but highly encouraged.
|
||||
|
||||
## Scaffold project website {#scaffold-project-website}
|
||||
|
@ -34,6 +34,8 @@ npx create-docusaurus@latest website classic
|
|||
|
||||
If you do not specify `name` or `template`, it will prompt you for them. We recommend the `classic` template so that you can get started quickly, and it contains features found in Docusaurus 1. The `classic` template contains `@docusaurus/preset-classic` which includes standard documentation, a blog, custom pages, and a CSS framework (with dark mode support). You can get up and running extremely quickly with the classic template and customize things later on when you have gained more familiarity with Docusaurus.
|
||||
|
||||
The `template` also accepts a git repo URL or a local file path, with the latter evaluated relative to the current working directory. The repo/folder content will be copied to the site directory.
|
||||
|
||||
**[FB-Only]:** If you are setting up a new Docusaurus website for a Facebook open source project, use the `facebook` template instead, which comes with some useful Facebook-specific defaults:
|
||||
|
||||
```bash
|
|
@ -106,6 +106,10 @@ module.exports = {
|
|||
pages: {},
|
||||
// Will be passed to @docusaurus/plugin-content-sitemap (false to disable)
|
||||
sitemap: {},
|
||||
// Will be passed to @docusaurus/plugin-google-gtag (only enabled when explicitly specified)
|
||||
gtag: {},
|
||||
// Will be passed to @docusaurus/plugin-google-analytics (only enabled when explicitly specified)
|
||||
googleAnalytics: {},
|
||||
},
|
||||
],
|
||||
],
|
|
@ -25,7 +25,7 @@ There are a few options you can use to add search to your website:
|
|||
|
||||
Docusaurus has **official support** for [Algolia DocSearch](https://docsearch.algolia.com).
|
||||
|
||||
The service is **free** in most cases: just [apply to the DocSearch program](https://docsearch.algolia.com/docs/apply).
|
||||
The service is **free** in most cases: just [apply to the DocSearch program](https://docsearch.algolia.com/apply).
|
||||
|
||||
It works by crawling the content of your website every 24 hours and putting all the content in an Algolia index. This content is then queried directly from your front-end using the Algolia API.
|
||||
|
||||
|
@ -58,14 +58,32 @@ It is highly recommended using a config similar to the [**Docusaurus 2 website c
|
|||
|
||||
### Connecting Algolia {#connecting-algolia}
|
||||
|
||||
Docusaurus' own `@docusaurus/preset-classic` supports an Algolia DocSearch integration.
|
||||
Docusaurus' own `@docusaurus/preset-classic` supports Algolia DocSearch integration. If you use the classic preset, no additional installation is needed.
|
||||
|
||||
To connect your docs with Algolia, first add the package to your website:
|
||||
<details>
|
||||
<summary>Installation steps when not using <code>@docusaurus/preset-classic</code></summary>
|
||||
|
||||
1. Install the package:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install --save @docusaurus/theme-search-algolia
|
||||
```
|
||||
|
||||
2. Register the theme in `docusaurus.config.js`:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
title: 'My site',
|
||||
// ...
|
||||
themes: ['@docusaurus/theme-search-algolia'],
|
||||
themeConfig: {
|
||||
// ...
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
Then, add an `algolia` field in your `themeConfig`. **[Apply for DocSearch](https://docsearch.algolia.com/apply/)** to get your Algolia index and API key.
|
||||
|
||||
```jsx title="docusaurus.config.js"
|
||||
|
@ -86,8 +104,8 @@ module.exports = {
|
|||
// Optional: see doc section below
|
||||
contextualSearch: true,
|
||||
|
||||
// Optional: see doc section below
|
||||
appId: 'YOUR_APP_ID',
|
||||
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
|
||||
externalUrlRegex: 'external\\.com|domain\\.com',
|
||||
|
||||
// Optional: Algolia search parameters
|
||||
searchParameters: {},
|
121
website/versioned_docs/version-2.0.0-beta.10/seo.md
Normal file
121
website/versioned_docs/version-2.0.0-beta.10/seo.md
Normal file
|
@ -0,0 +1,121 @@
|
|||
---
|
||||
id: seo
|
||||
title: Search engine optimization (SEO)
|
||||
sidebar_label: SEO
|
||||
keywords:
|
||||
- seo
|
||||
- positioning
|
||||
---
|
||||
|
||||
Docusaurus supports search engine optimization in a variety of ways.
|
||||
|
||||
## Global metadata {#global-metadata}
|
||||
|
||||
Provide global meta attributes for the entire site through the [site configuration](./configuration.md#site-metadata). The metadata will all be rendered in the HTML `<head>` using the key-value pairs as the prop name and value.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
themeConfig: {
|
||||
metadata: [{name: 'keywords', content: 'cooking, blog'}],
|
||||
// This would become <meta name="keywords" content="cooking, blog"> in the generated HTML
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
Docusaurus adds some metadata out-of-the-box. For example, if you have configured [i18n](./i18n/i18n-introduction.md), you will get a [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) alternate link.
|
||||
|
||||
To read more about types of meta tags, visit [the MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta).
|
||||
|
||||
## Single page metadata {#single-page-metadata}
|
||||
|
||||
Similar to [global metadata](#global-metadata), Docusaurus also allows for the addition of meta-information to individual pages. Follow [this guide](./guides/markdown-features/markdown-features-head-metadata.mdx) for configuring the `<head>` tag. In short:
|
||||
|
||||
```md title="my-markdown-page.md"
|
||||
# A cooking guide
|
||||
|
||||
<head>
|
||||
<meta name="keywords" content="cooking, blog">
|
||||
</head>
|
||||
|
||||
Some content...
|
||||
```
|
||||
|
||||
```jsx title="my-react-page.jsx"
|
||||
import React from 'react';
|
||||
import Head from '@docusaurus/Head';
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<Layout title="Page" description="A React page demo">
|
||||
<Head>
|
||||
<meta property="og:image" content="image.png" />
|
||||
</Head>
|
||||
{/* ... */}
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Docusaurus automatically adds `description`, `title`, canonical URL links, and other useful metadata to each Markdown page. They are configurable through front matter:
|
||||
|
||||
```yml
|
||||
---
|
||||
title: Title for search engines; can be different from the actual heading
|
||||
description: A short description of this page
|
||||
image: a thumbnail image to be shown in social media cards
|
||||
keywords: [keywords, describing, the main topics]
|
||||
---
|
||||
```
|
||||
|
||||
When creating your React page, adding these fields in `Layout` would also improve SEO.
|
||||
|
||||
## Static HTML generation {#static-html-generation}
|
||||
|
||||
Docusaurus is a static site generator—HTML files are statically generated for every URL route, which helps search engines discover your content more easily.
|
||||
|
||||
## Image meta description {#image-meta-description}
|
||||
|
||||
The alt tag for an image tells the search engine what the image is about, and is used when the image can't be visually seen, e.g. when using a screen reader, or when the image is broken. Alt tags are commonly supported in Markdown.
|
||||
|
||||
You may also add a title for your image—this doesn't impact SEO much, but is displayed as tooltip when hovering above the image, usually used to provide hints.
|
||||
|
||||
```md
|
||||

|
||||
```
|
||||
|
||||

|
||||
|
||||
## Rich search information {#rich-search-information}
|
||||
|
||||
Docusaurus blogs support [rich search results](https://search.google.com/test/rich-results) out-of-the-box to get maximum search engine experience. The information is created depending on your meta information in blog/global configuration. In order to get the benefits of the rich search information, fill in the information about the post's publish date, authors, and image, etc. Read more about the meta-information [here](./blog.mdx).
|
||||
|
||||
## Robots file {#robots-file}
|
||||
|
||||
To add a `robots.txt` file that regulates search engines' behavior about which should be displayed and which shouldn't, provide it as [static asset](./static-assets.md). The following would allow access to all sub-pages from all requests:
|
||||
|
||||
```text title="static/robots.txt"
|
||||
User-agent: *
|
||||
Disallow:
|
||||
```
|
||||
|
||||
Read more about the robots file in [the Google documentation](https://developers.google.com/search/docs/advanced/robots/intro).
|
||||
|
||||
:::caution
|
||||
|
||||
**Important**: the `robots.txt` file does **not** prevent HTML pages from being indexed. Use `<meta name="robots" content="noindex">` as [page metadata](#single-page-metadata) to prevent it from appearing in search results entirely.
|
||||
|
||||
:::
|
||||
|
||||
## Sitemap file {#sitemap-file}
|
||||
|
||||
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.
|
||||
|
||||
## 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.
|
||||
|
||||
## Structured content {#structured-content}
|
||||
|
||||
Search engines rely on the HTML markup such as `<h2>`, `<table>`, etc., to understand the structure of your webpage. When Docusaurus renders your pages, semantic markup, e.g. `<aside>`, `<nav>`, `<main>`, are used to divide the different sections of the page, helping the search engine to locate parts like sidebar, navbar, and the main page content.
|
||||
|
||||
Most [CommonMark](https://spec.commonmark.org/0.30/#atx-headings) syntax have their corresponding HTML tags. By using Markdown consistently in your project, you will make it easier for search engines to understand your page content.
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue