From 675de79d942ff9894a7222da542fb31cdee05f3d Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Wed, 2 Feb 2022 13:10:21 +0300 Subject: [PATCH] docs: Add initial version of the documentation pages --- packages/docs/docs/advanced/_category_.json | 4 + .../configuration.md} | 2 +- .../credentials.md} | 4 +- .../database.md} | 2 +- .../deployment.md} | 4 +- packages/docs/docs/apps/_category_.json | 4 - packages/docs/docs/community.md | 36 +++++ .../docs/contributing/build-integration.md | 88 +++++++++++ .../contribution-guide.md} | 2 +- .../docs/contributing/manage-docs-versions.md | 55 ------- packages/docs/docs/faq.md | 36 +++++ packages/docs/docs/faq/_category_.json | 4 - .../docs/docs/getting-started/_category_.json | 4 + .../congratulations.md | 0 .../create-flow.md} | 2 +- .../installation.md} | 2 +- .../key-concepts.md} | 2 +- .../docs/docs/installation/_category_.json | 4 - .../docs/installation/deploy-your-site.md | 31 ---- .../docs/installation/markdown-features.mdx | 144 ------------------ .../docs/docs/integrations/_category_.json | 4 + .../available-apps.md} | 2 +- .../request-integration.md} | 2 +- packages/docs/docs/license.md | 36 +++++ packages/docs/docs/license/_category_.json | 4 - packages/docs/docs/{intro.md => overview.md} | 2 +- packages/docs/docs/usage/_category_.json | 4 - .../docs/docs/usage/manage-docs-versions.md | 55 ------- .../docs/docs/usage/translate-your-site.md | 88 ----------- packages/docs/docusaurus.config.js | 4 +- 30 files changed, 223 insertions(+), 408 deletions(-) create mode 100644 packages/docs/docs/advanced/_category_.json rename packages/docs/docs/{faq/manage-docs-versions.md => advanced/configuration.md} (98%) rename packages/docs/docs/{apps/translate-your-site.md => advanced/credentials.md} (97%) rename packages/docs/docs/{contributing/translate-your-site.md => advanced/database.md} (98%) rename packages/docs/docs/{license/translate-your-site.md => advanced/deployment.md} (97%) delete mode 100644 packages/docs/docs/apps/_category_.json create mode 100644 packages/docs/docs/community.md create mode 100644 packages/docs/docs/contributing/build-integration.md rename packages/docs/docs/{apps/manage-docs-versions.md => contributing/contribution-guide.md} (98%) delete mode 100644 packages/docs/docs/contributing/manage-docs-versions.md create mode 100644 packages/docs/docs/faq.md delete mode 100644 packages/docs/docs/faq/_category_.json create mode 100644 packages/docs/docs/getting-started/_category_.json rename packages/docs/docs/{installation => getting-started}/congratulations.md (100%) rename packages/docs/docs/{installation/create-a-blog-post.md => getting-started/create-flow.md} (97%) rename packages/docs/docs/{installation/create-a-page.md => getting-started/installation.md} (98%) rename packages/docs/docs/{installation/create-a-document.md => getting-started/key-concepts.md} (97%) delete mode 100644 packages/docs/docs/installation/_category_.json delete mode 100644 packages/docs/docs/installation/deploy-your-site.md delete mode 100644 packages/docs/docs/installation/markdown-features.mdx create mode 100644 packages/docs/docs/integrations/_category_.json rename packages/docs/docs/{license/manage-docs-versions.md => integrations/available-apps.md} (98%) rename packages/docs/docs/{faq/translate-your-site.md => integrations/request-integration.md} (98%) create mode 100644 packages/docs/docs/license.md delete mode 100644 packages/docs/docs/license/_category_.json rename packages/docs/docs/{intro.md => overview.md} (97%) delete mode 100644 packages/docs/docs/usage/_category_.json delete mode 100644 packages/docs/docs/usage/manage-docs-versions.md delete mode 100644 packages/docs/docs/usage/translate-your-site.md diff --git a/packages/docs/docs/advanced/_category_.json b/packages/docs/docs/advanced/_category_.json new file mode 100644 index 00000000..c039890a --- /dev/null +++ b/packages/docs/docs/advanced/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Advanced", + "position": 4 +} diff --git a/packages/docs/docs/faq/manage-docs-versions.md b/packages/docs/docs/advanced/configuration.md similarity index 98% rename from packages/docs/docs/faq/manage-docs-versions.md rename to packages/docs/docs/advanced/configuration.md index 6335b0ac..93ab2b0c 100644 --- a/packages/docs/docs/faq/manage-docs-versions.md +++ b/packages/docs/docs/advanced/configuration.md @@ -2,7 +2,7 @@ sidebar_position: 1 --- -# Manage Docs Versions +# Configuration Docusaurus can manage multiple versions of your docs. diff --git a/packages/docs/docs/apps/translate-your-site.md b/packages/docs/docs/advanced/credentials.md similarity index 97% rename from packages/docs/docs/apps/translate-your-site.md rename to packages/docs/docs/advanced/credentials.md index a25c089e..8c1a3ee5 100644 --- a/packages/docs/docs/apps/translate-your-site.md +++ b/packages/docs/docs/advanced/credentials.md @@ -1,8 +1,8 @@ --- -sidebar_position: 2 +sidebar_position: 3 --- -# Translate your site +# Credentials Let's translate `docs/intro.md` to French. diff --git a/packages/docs/docs/contributing/translate-your-site.md b/packages/docs/docs/advanced/database.md similarity index 98% rename from packages/docs/docs/contributing/translate-your-site.md rename to packages/docs/docs/advanced/database.md index a25c089e..8970a7de 100644 --- a/packages/docs/docs/contributing/translate-your-site.md +++ b/packages/docs/docs/advanced/database.md @@ -2,7 +2,7 @@ sidebar_position: 2 --- -# Translate your site +# Database Let's translate `docs/intro.md` to French. diff --git a/packages/docs/docs/license/translate-your-site.md b/packages/docs/docs/advanced/deployment.md similarity index 97% rename from packages/docs/docs/license/translate-your-site.md rename to packages/docs/docs/advanced/deployment.md index a25c089e..82da786e 100644 --- a/packages/docs/docs/license/translate-your-site.md +++ b/packages/docs/docs/advanced/deployment.md @@ -1,8 +1,8 @@ --- -sidebar_position: 2 +sidebar_position: 4 --- -# Translate your site +# Deployment Let's translate `docs/intro.md` to French. diff --git a/packages/docs/docs/apps/_category_.json b/packages/docs/docs/apps/_category_.json deleted file mode 100644 index 28300824..00000000 --- a/packages/docs/docs/apps/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Apps", - "position": 4 -} diff --git a/packages/docs/docs/community.md b/packages/docs/docs/community.md new file mode 100644 index 00000000..08b77c92 --- /dev/null +++ b/packages/docs/docs/community.md @@ -0,0 +1,36 @@ +--- +sidebar_position: 7 +slug: /community +--- + +# Community + +Let's discover **Docusaurus in less than 5 minutes**. + +## Getting Started + +Get started by **creating a new site**. + +Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. + +## Generate a new site + +Generate a new Docusaurus site using the **classic template**: + +```shell +npm init docusaurus@latest my-website classic +``` + +## Start your site + +Run the development server: + +```shell +cd my-website + +npx docusaurus start +``` + +Your site starts at `http://localhost:3000`. + +Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes. diff --git a/packages/docs/docs/contributing/build-integration.md b/packages/docs/docs/contributing/build-integration.md new file mode 100644 index 00000000..eff596be --- /dev/null +++ b/packages/docs/docs/contributing/build-integration.md @@ -0,0 +1,88 @@ +--- +sidebar_position: 3 +--- + +# Build Integration + +Let's translate `docs/intro.md` to French. + +## Configure i18n + +Modify `docusaurus.config.js` to add support for the `fr` locale: + +```js title="docusaurus.config.js" +module.exports = { + i18n: { + defaultLocale: 'en', + locales: ['en', 'fr'], + }, +}; +``` + +## Translate a doc + +Copy the `docs/intro.md` file to the `i18n/fr` folder: + +```bash +mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/ + +cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md +``` + +Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French. + +## Start your localized site + +Start your site on the French locale: + +```bash +npm run start -- --locale fr +``` + +Your localized site is accessible at `http://localhost:3000/fr/` and the `Getting Started` page is translated. + +:::caution + +In development, you can only use one locale at a same time. + +::: + +## Add a Locale Dropdown + +To navigate seamlessly across languages, add a locale dropdown. + +Modify the `docusaurus.config.js` file: + +```js title="docusaurus.config.js" +module.exports = { + themeConfig: { + navbar: { + items: [ + // highlight-start + { + type: 'localeDropdown', + }, + // highlight-end + ], + }, + }, +}; +``` + +The locale dropdown now appears in your navbar: + +![Locale Dropdown](/img/tutorial/localeDropdown.png) + +## Build your localized site + +Build your site for a specific locale: + +```bash +npm run build -- --locale fr +``` + +Or build your site to include all the locales at once: + +```bash +npm run build +``` diff --git a/packages/docs/docs/apps/manage-docs-versions.md b/packages/docs/docs/contributing/contribution-guide.md similarity index 98% rename from packages/docs/docs/apps/manage-docs-versions.md rename to packages/docs/docs/contributing/contribution-guide.md index 6335b0ac..a5160ed2 100644 --- a/packages/docs/docs/apps/manage-docs-versions.md +++ b/packages/docs/docs/contributing/contribution-guide.md @@ -2,7 +2,7 @@ sidebar_position: 1 --- -# Manage Docs Versions +# Contribution Guide Docusaurus can manage multiple versions of your docs. diff --git a/packages/docs/docs/contributing/manage-docs-versions.md b/packages/docs/docs/contributing/manage-docs-versions.md deleted file mode 100644 index 6335b0ac..00000000 --- a/packages/docs/docs/contributing/manage-docs-versions.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Manage Docs Versions - -Docusaurus can manage multiple versions of your docs. - -## Create a docs version - -Release a version 1.0 of your project: - -```bash -npm run docusaurus docs:version 1.0 -``` - -The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created. - -Your docs now have 2 versions: - -- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs -- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs** - -## Add a Version Dropdown - -To navigate seamlessly across versions, add a version dropdown. - -Modify the `docusaurus.config.js` file: - -```js title="docusaurus.config.js" -module.exports = { - themeConfig: { - navbar: { - items: [ - // highlight-start - { - type: 'docsVersionDropdown', - }, - // highlight-end - ], - }, - }, -}; -``` - -The docs version dropdown appears in your navbar: - -![Docs Version Dropdown](/img/tutorial/docsVersionDropdown.png) - -## Update an existing version - -It is possible to edit versioned docs in their respective folder: - -- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello` -- `docs/hello.md` updates `http://localhost:3000/docs/next/hello` diff --git a/packages/docs/docs/faq.md b/packages/docs/docs/faq.md new file mode 100644 index 00000000..850a73a5 --- /dev/null +++ b/packages/docs/docs/faq.md @@ -0,0 +1,36 @@ +--- +sidebar_position: 8 +slug: /faq +--- + +# F.A.Q + +Let's discover **Docusaurus in less than 5 minutes**. + +## Getting Started + +Get started by **creating a new site**. + +Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. + +## Generate a new site + +Generate a new Docusaurus site using the **classic template**: + +```shell +npm init docusaurus@latest my-website classic +``` + +## Start your site + +Run the development server: + +```shell +cd my-website + +npx docusaurus start +``` + +Your site starts at `http://localhost:3000`. + +Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes. diff --git a/packages/docs/docs/faq/_category_.json b/packages/docs/docs/faq/_category_.json deleted file mode 100644 index 7783349c..00000000 --- a/packages/docs/docs/faq/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "F.A.Q", - "position": 6 -} diff --git a/packages/docs/docs/getting-started/_category_.json b/packages/docs/docs/getting-started/_category_.json new file mode 100644 index 00000000..877a378f --- /dev/null +++ b/packages/docs/docs/getting-started/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Getting Started", + "position": 2 +} diff --git a/packages/docs/docs/installation/congratulations.md b/packages/docs/docs/getting-started/congratulations.md similarity index 100% rename from packages/docs/docs/installation/congratulations.md rename to packages/docs/docs/getting-started/congratulations.md diff --git a/packages/docs/docs/installation/create-a-blog-post.md b/packages/docs/docs/getting-started/create-flow.md similarity index 97% rename from packages/docs/docs/installation/create-a-blog-post.md rename to packages/docs/docs/getting-started/create-flow.md index 0d50aaf3..512ceb08 100644 --- a/packages/docs/docs/installation/create-a-blog-post.md +++ b/packages/docs/docs/getting-started/create-flow.md @@ -2,7 +2,7 @@ sidebar_position: 3 --- -# Create a Blog Post +# Create Flow Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed... diff --git a/packages/docs/docs/installation/create-a-page.md b/packages/docs/docs/getting-started/installation.md similarity index 98% rename from packages/docs/docs/installation/create-a-page.md rename to packages/docs/docs/getting-started/installation.md index e112b005..636e8f75 100644 --- a/packages/docs/docs/installation/create-a-page.md +++ b/packages/docs/docs/getting-started/installation.md @@ -2,7 +2,7 @@ sidebar_position: 1 --- -# Create a Page +# Installation Add **Markdown or React** files to `src/pages` to create a **standalone page**: diff --git a/packages/docs/docs/installation/create-a-document.md b/packages/docs/docs/getting-started/key-concepts.md similarity index 97% rename from packages/docs/docs/installation/create-a-document.md rename to packages/docs/docs/getting-started/key-concepts.md index b4a072ec..59685a0d 100644 --- a/packages/docs/docs/installation/create-a-document.md +++ b/packages/docs/docs/getting-started/key-concepts.md @@ -2,7 +2,7 @@ sidebar_position: 2 --- -# Create a Document +# Key Concepts Documents are **groups of pages** connected through: diff --git a/packages/docs/docs/installation/_category_.json b/packages/docs/docs/installation/_category_.json deleted file mode 100644 index e1112892..00000000 --- a/packages/docs/docs/installation/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Installation", - "position": 2 -} diff --git a/packages/docs/docs/installation/deploy-your-site.md b/packages/docs/docs/installation/deploy-your-site.md deleted file mode 100644 index 492eae02..00000000 --- a/packages/docs/docs/installation/deploy-your-site.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -sidebar_position: 5 ---- - -# Deploy your site - -Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**). - -It builds your site as simple **static HTML, JavaScript and CSS files**. - -## Build your site - -Build your site **for production**: - -```bash -npm run build -``` - -The static files are generated in the `build` folder. - -## Deploy your site - -Test your production build locally: - -```bash -npm run serve -``` - -The `build` folder is now served at `http://localhost:3000/`. - -You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**). diff --git a/packages/docs/docs/installation/markdown-features.mdx b/packages/docs/docs/installation/markdown-features.mdx deleted file mode 100644 index 88556260..00000000 --- a/packages/docs/docs/installation/markdown-features.mdx +++ /dev/null @@ -1,144 +0,0 @@ ---- -sidebar_position: 4 ---- - -# Markdown Features - -Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**. - -## Front Matter - -Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/): - -```text title="my-doc.md" -// highlight-start ---- -id: my-doc-id -title: My document title -description: My document description -slug: /my-custom-url ---- -// highlight-end - -## Markdown heading - -Markdown text with [links](./hello.md) -``` - -## Links - -Regular Markdown links are supported, using url paths or relative file paths. - -```md -Let's see how to [Create a page](/create-a-page). -``` - -```md -Let's see how to [Create a page](./create-a-page.md). -``` - -**Result:** Let's see how to [Create a page](./create-a-page.md). - -## Images - -Regular Markdown images are supported. - -Add an image at `static/img/docusaurus.png` and display it in Markdown: - -```md -![Docusaurus logo](/img/docusaurus.png) -``` - -![Docusaurus logo](/img/docusaurus.png) - -## Code Blocks - -Markdown code blocks are supported with Syntax highlighting. - - ```jsx title="src/components/HelloDocusaurus.js" - function HelloDocusaurus() { - return ( -

Hello, Docusaurus!

- ) - } - ``` - -```jsx title="src/components/HelloDocusaurus.js" -function HelloDocusaurus() { - return

Hello, Docusaurus!

; -} -``` - -## Admonitions - -Docusaurus has a special syntax to create admonitions and callouts: - - :::tip My tip - - Use this awesome feature option - - ::: - - :::danger Take care - - This action is dangerous - - ::: - -:::tip My tip - -Use this awesome feature option - -::: - -:::danger Take care - -This action is dangerous - -::: - -## MDX and React Components - -[MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**: - -```jsx -export const Highlight = ({children, color}) => ( - { - alert(`You clicked the color ${color} with label ${children}`) - }}> - {children} - -); - -This is Docusaurus green ! - -This is Facebook blue ! -``` - -export const Highlight = ({children, color}) => ( - { - alert(`You clicked the color ${color} with label ${children}`); - }}> - {children} - -); - -This is Docusaurus green ! - -This is Facebook blue ! diff --git a/packages/docs/docs/integrations/_category_.json b/packages/docs/docs/integrations/_category_.json new file mode 100644 index 00000000..cefe73a6 --- /dev/null +++ b/packages/docs/docs/integrations/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Integrations", + "position": 3 +} diff --git a/packages/docs/docs/license/manage-docs-versions.md b/packages/docs/docs/integrations/available-apps.md similarity index 98% rename from packages/docs/docs/license/manage-docs-versions.md rename to packages/docs/docs/integrations/available-apps.md index 6335b0ac..d5a91be0 100644 --- a/packages/docs/docs/license/manage-docs-versions.md +++ b/packages/docs/docs/integrations/available-apps.md @@ -2,7 +2,7 @@ sidebar_position: 1 --- -# Manage Docs Versions +# Available Apps Docusaurus can manage multiple versions of your docs. diff --git a/packages/docs/docs/faq/translate-your-site.md b/packages/docs/docs/integrations/request-integration.md similarity index 98% rename from packages/docs/docs/faq/translate-your-site.md rename to packages/docs/docs/integrations/request-integration.md index a25c089e..846605e8 100644 --- a/packages/docs/docs/faq/translate-your-site.md +++ b/packages/docs/docs/integrations/request-integration.md @@ -2,7 +2,7 @@ sidebar_position: 2 --- -# Translate your site +# Request Integration Let's translate `docs/intro.md` to French. diff --git a/packages/docs/docs/license.md b/packages/docs/docs/license.md new file mode 100644 index 00000000..e1c34e8d --- /dev/null +++ b/packages/docs/docs/license.md @@ -0,0 +1,36 @@ +--- +sidebar_position: 6 +slug: /license +--- + +# License + +Let's discover **Docusaurus in less than 5 minutes**. + +## Getting Started + +Get started by **creating a new site**. + +Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. + +## Generate a new site + +Generate a new Docusaurus site using the **classic template**: + +```shell +npm init docusaurus@latest my-website classic +``` + +## Start your site + +Run the development server: + +```shell +cd my-website + +npx docusaurus start +``` + +Your site starts at `http://localhost:3000`. + +Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes. diff --git a/packages/docs/docs/license/_category_.json b/packages/docs/docs/license/_category_.json deleted file mode 100644 index 50ed5e62..00000000 --- a/packages/docs/docs/license/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "License", - "position": 5 -} diff --git a/packages/docs/docs/intro.md b/packages/docs/docs/overview.md similarity index 97% rename from packages/docs/docs/intro.md rename to packages/docs/docs/overview.md index 8a7a2faf..50dedf53 100644 --- a/packages/docs/docs/intro.md +++ b/packages/docs/docs/overview.md @@ -3,7 +3,7 @@ sidebar_position: 1 slug: / --- -# Introduction +# Overview Let's discover **Docusaurus in less than 5 minutes**. diff --git a/packages/docs/docs/usage/_category_.json b/packages/docs/docs/usage/_category_.json deleted file mode 100644 index 0365f6c3..00000000 --- a/packages/docs/docs/usage/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Usage", - "position": 3 -} diff --git a/packages/docs/docs/usage/manage-docs-versions.md b/packages/docs/docs/usage/manage-docs-versions.md deleted file mode 100644 index 6335b0ac..00000000 --- a/packages/docs/docs/usage/manage-docs-versions.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Manage Docs Versions - -Docusaurus can manage multiple versions of your docs. - -## Create a docs version - -Release a version 1.0 of your project: - -```bash -npm run docusaurus docs:version 1.0 -``` - -The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created. - -Your docs now have 2 versions: - -- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs -- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs** - -## Add a Version Dropdown - -To navigate seamlessly across versions, add a version dropdown. - -Modify the `docusaurus.config.js` file: - -```js title="docusaurus.config.js" -module.exports = { - themeConfig: { - navbar: { - items: [ - // highlight-start - { - type: 'docsVersionDropdown', - }, - // highlight-end - ], - }, - }, -}; -``` - -The docs version dropdown appears in your navbar: - -![Docs Version Dropdown](/img/tutorial/docsVersionDropdown.png) - -## Update an existing version - -It is possible to edit versioned docs in their respective folder: - -- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello` -- `docs/hello.md` updates `http://localhost:3000/docs/next/hello` diff --git a/packages/docs/docs/usage/translate-your-site.md b/packages/docs/docs/usage/translate-your-site.md deleted file mode 100644 index a25c089e..00000000 --- a/packages/docs/docs/usage/translate-your-site.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -sidebar_position: 2 ---- - -# Translate your site - -Let's translate `docs/intro.md` to French. - -## Configure i18n - -Modify `docusaurus.config.js` to add support for the `fr` locale: - -```js title="docusaurus.config.js" -module.exports = { - i18n: { - defaultLocale: 'en', - locales: ['en', 'fr'], - }, -}; -``` - -## Translate a doc - -Copy the `docs/intro.md` file to the `i18n/fr` folder: - -```bash -mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/ - -cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md -``` - -Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French. - -## Start your localized site - -Start your site on the French locale: - -```bash -npm run start -- --locale fr -``` - -Your localized site is accessible at `http://localhost:3000/fr/` and the `Getting Started` page is translated. - -:::caution - -In development, you can only use one locale at a same time. - -::: - -## Add a Locale Dropdown - -To navigate seamlessly across languages, add a locale dropdown. - -Modify the `docusaurus.config.js` file: - -```js title="docusaurus.config.js" -module.exports = { - themeConfig: { - navbar: { - items: [ - // highlight-start - { - type: 'localeDropdown', - }, - // highlight-end - ], - }, - }, -}; -``` - -The locale dropdown now appears in your navbar: - -![Locale Dropdown](/img/tutorial/localeDropdown.png) - -## Build your localized site - -Build your site for a specific locale: - -```bash -npm run build -- --locale fr -``` - -Or build your site to include all the locales at once: - -```bash -npm run build -``` diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js index d9f94f55..76884a06 100644 --- a/packages/docs/docusaurus.config.js +++ b/packages/docs/docusaurus.config.js @@ -25,7 +25,7 @@ const config = { sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', - routeBasePath: '/' + routeBasePath: '/', }, blog: { showReadingTime: true, @@ -48,7 +48,7 @@ const config = { items: [ { type: 'doc', - docId: 'intro', + docId: 'overview', position: 'left', label: 'Docs', },