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: + + + +## 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: - - - -## 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 - -``` - - - -## Code Blocks - -Markdown code blocks are supported with Syntax highlighting. - - ```jsx title="src/components/HelloDocusaurus.js" - function HelloDocusaurus() { - return ( -