docs(v2): fix incorrect anchor links in website (#5021)

* docs: fix anchor links for docusaurus write-translations

* docs: fix anchor links for docusaurus serve
This commit is contained in:
Teik Jun 2021-06-21 03:16:17 +08:00 committed by GitHub
parent 9fdbd48279
commit c96c3b5c39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 27 additions and 27 deletions

View file

@ -241,7 +241,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-docs` - **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-docs`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-docs-<pluginId>` - **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-docs-<pluginId>`
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-docs/<version>` - **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-docs/<version>`
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -75,7 +75,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-pages` - **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-pages`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-pages-<pluginId>` - **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-pages-<pluginId>`
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-pages` - **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-pages`
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -125,7 +125,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-theme-<themeName>` - **Base path**: `website/i18n/<locale>/docusaurus-theme-<themeName>`
- **Multi-instance path**: N/A - **Multi-instance path**: N/A
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `N/A - **Markdown files**: `N/A
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -27,7 +27,7 @@ A Docusaurus site is statically rendered, and it can generally work without Java
It is important to test your build locally before deploying to production. It is important to test your build locally before deploying to production.
Docusaurus includes a [`docusaurus serve`](cli.md#docusaurus-serve) command for that: Docusaurus includes a [`docusaurus serve`](cli.md#docusaurus-serve-sitedir) command for that:
```bash npm2yarn ```bash npm2yarn
npm run serve npm run serve
@ -51,7 +51,7 @@ Use [slorber/trailing-slash-guide](https://github.com/slorber/trailing-slash-gui
## Self-Hosting {#self-hosting} ## Self-Hosting {#self-hosting}
Docusaurus can be self-hosted using [`docusaurus serve`](cli.md#docusaurus-serve). Change port using `--port` and `--host` to change host. Docusaurus can be self-hosted using [`docusaurus serve`](cli.md#docusaurus-serve-sitedir). Change port using `--port` and `--host` to change host.
```bash npm2yarn ```bash npm2yarn
npm run serve -- --build --port 80 --host 0.0.0.0 npm run serve -- --build --port 80 --host 0.0.0.0

View file

@ -164,7 +164,7 @@ export default function VisitMyWebsiteMessage() {
When [localizing your site](./i18n/i18n-introduction.md), the `<Translate/>` component will allow providing **translation support to React components**, such as your homepage. The `<Translate>` component supports [interpolation](#interpolate). When [localizing your site](./i18n/i18n-introduction.md), the `<Translate/>` component will allow providing **translation support to React components**, such as your homepage. The `<Translate>` component supports [interpolation](#interpolate).
The translation strings will be extracted from your code with the [`docusaurus write-translations`](./cli.md#docusaurus-write-translations) CLI and create a `code.json` translation file in `website/i18n/<locale>`. The translation strings will be extracted from your code with the [`docusaurus write-translations`](./cli.md#docusaurus-write-translations-sitedir) CLI and create a `code.json` translation file in `website/i18n/<locale>`.
:::note :::note

View file

@ -88,7 +88,7 @@ export default function Home() {
### Initialize the `i18n` folder {#initialize-the-i18n-folder} ### Initialize the `i18n` folder {#initialize-the-i18n-folder}
Use the [write-translations](../cli.md#docusaurus-write-translations) CLI command to initialize the JSON translation files for the French locale: Use the [write-translations](../cli.md#docusaurus-write-translations-sitedir) CLI command to initialize the JSON translation files for the French locale:
```bash npm2yarn ```bash npm2yarn
npm run write-translations -- --locale fr npm run write-translations -- --locale fr
@ -157,7 +157,7 @@ To keep your translated sites consistent, when the `website/docs/doc1.md` doc is
### JSON translations {#json-translations} ### JSON translations {#json-translations}
To help you maintain the JSON translation files, it is possible to run again the [write-translations](../cli.md#docusaurus-write-translations) CLI command: To help you maintain the JSON translation files, it is possible to run again the [write-translations](../cli.md#docusaurus-write-translations-sitedir) CLI command:
```bash npm2yarn ```bash npm2yarn
npm run write-translations -- --locale fr npm run write-translations -- --locale fr

View file

@ -122,7 +122,7 @@ website/i18n
└── navbar.json └── navbar.json
``` ```
The JSON files are initialized with the [`docusaurus write-translations`](../cli.md#docusaurus-write-translations) CLI command. The JSON files are initialized with the [`docusaurus write-translations`](../cli.md#docusaurus-write-translations-sitedir) CLI command.
The `code.json` file is extracted from React components using the `<Translate>` API. The `code.json` file is extracted from React components using the `<Translate>` API.

View file

@ -236,7 +236,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-docs` - **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-docs`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-docs-<pluginId>` - **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-docs-<pluginId>`
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-docs/<version>` - **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-docs/<version>`
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -75,7 +75,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-pages` - **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-pages`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-pages-<pluginId>` - **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-pages-<pluginId>`
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-pages` - **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-pages`
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -125,7 +125,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-theme-<themeName>` - **Base path**: `website/i18n/<locale>/docusaurus-theme-<themeName>`
- **Multi-instance path**: N/A - **Multi-instance path**: N/A
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `N/A - **Markdown files**: `N/A
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -15,7 +15,7 @@ You can deploy your site to static site hosting services such as [Vercel](https:
## Testing Build Local {#testing-build-local} ## Testing Build Local {#testing-build-local}
It is important to test build before deploying to a production. Docusaurus includes a [`docusaurus serve`](cli.md#docusaurus-serve) command to test build locally. It is important to test build before deploying to a production. Docusaurus includes a [`docusaurus serve`](cli.md#docusaurus-serve-sitedir) command to test build locally.
```bash npm2yarn ```bash npm2yarn
npm run serve npm run serve
@ -29,7 +29,7 @@ It is not the most performant solution
::: :::
Docusaurus can be self hosted using [`docusaurus serve`](cli.md#docusaurus-serve). Change port using `--port` and `--host` to change host. Docusaurus can be self hosted using [`docusaurus serve`](cli.md#docusaurus-serve-sitedir). Change port using `--port` and `--host` to change host.
```bash npm2yarn ```bash npm2yarn
npm run serve -- --build --port 80 --host 0.0.0.0 npm run serve -- --build --port 80 --host 0.0.0.0

View file

@ -164,7 +164,7 @@ export default function VisitMyWebsiteMessage() {
When [localizing your site](./i18n/i18n-introduction.md), the `<Translate/>` component will allow providing **translation support to React components**, such as your homepage. The `<Translate>` component supports [interpolation](#interpolate). When [localizing your site](./i18n/i18n-introduction.md), the `<Translate/>` component will allow providing **translation support to React components**, such as your homepage. The `<Translate>` component supports [interpolation](#interpolate).
The translation strings will be extracted from your code with the [`docusaurus write-translations`](./cli.md#docusaurus-write-translations) CLI and create a `code.json` translation file in `website/i18n/<locale>`. The translation strings will be extracted from your code with the [`docusaurus write-translations`](./cli.md#docusaurus-write-translations-sitedir) CLI and create a `code.json` translation file in `website/i18n/<locale>`.
:::note :::note

View file

@ -88,7 +88,7 @@ export default function Home() {
### Initialize the `i18n` folder {#initialize-the-i18n-folder} ### Initialize the `i18n` folder {#initialize-the-i18n-folder}
Use the [write-translations](../cli.md#docusaurus-write-translations) CLI command to initialize the JSON translation files for the French locale: Use the [write-translations](../cli.md#docusaurus-write-translations-sitedir) CLI command to initialize the JSON translation files for the French locale:
```bash npm2yarn ```bash npm2yarn
npm run write-translations -- --locale fr npm run write-translations -- --locale fr
@ -157,7 +157,7 @@ To keep your translated sites consistent, when the `website/docs/doc1.md` doc is
### JSON translations {#json-translations} ### JSON translations {#json-translations}
To help you maintain the JSON translation files, it is possible to run again the [write-translations](../cli.md#docusaurus-write-translations) CLI command: To help you maintain the JSON translation files, it is possible to run again the [write-translations](../cli.md#docusaurus-write-translations-sitedir) CLI command:
```bash npm2yarn ```bash npm2yarn
npm run write-translations -- --locale fr npm run write-translations -- --locale fr

View file

@ -122,7 +122,7 @@ website/i18n
└── navbar.json └── navbar.json
``` ```
The JSON files are initialized with the [`docusaurus write-translations`](../cli.md#docusaurus-write-translations) CLI command. The JSON files are initialized with the [`docusaurus write-translations`](../cli.md#docusaurus-write-translations-sitedir) CLI command.
The `code.json` file is extracted from React components using the `<Translate>` API. The `code.json` file is extracted from React components using the `<Translate>` API.

View file

@ -241,7 +241,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-docs` - **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-docs`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-docs-<pluginId>` - **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-docs-<pluginId>`
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-docs/<version>` - **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-docs/<version>`
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -75,7 +75,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-pages` - **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-pages`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-pages-<pluginId>` - **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-pages-<pluginId>`
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-pages` - **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-pages`
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -125,7 +125,7 @@ Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
- **Base path**: `website/i18n/<locale>/docusaurus-theme-<themeName>` - **Base path**: `website/i18n/<locale>/docusaurus-theme-<themeName>`
- **Multi-instance path**: N/A - **Multi-instance path**: N/A
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations) - **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations-sitedir)
- **Markdown files**: `N/A - **Markdown files**: `N/A
### Example file-system structure {#example-file-system-structure} ### Example file-system structure {#example-file-system-structure}

View file

@ -27,7 +27,7 @@ A Docusaurus site is statically rendered, and it can generally work without Java
It is important to test your build locally before deploying to production. It is important to test your build locally before deploying to production.
Docusaurus includes a [`docusaurus serve`](cli.md#docusaurus-serve) command for that: Docusaurus includes a [`docusaurus serve`](cli.md#docusaurus-serve-sitedir) command for that:
```bash npm2yarn ```bash npm2yarn
npm run serve npm run serve
@ -51,7 +51,7 @@ Use [slorber/trailing-slash-guide](https://github.com/slorber/trailing-slash-gui
## Self-Hosting {#self-hosting} ## Self-Hosting {#self-hosting}
Docusaurus can be self-hosted using [`docusaurus serve`](cli.md#docusaurus-serve). Change port using `--port` and `--host` to change host. Docusaurus can be self-hosted using [`docusaurus serve`](cli.md#docusaurus-serve-sitedir). Change port using `--port` and `--host` to change host.
```bash npm2yarn ```bash npm2yarn
npm run serve -- --build --port 80 --host 0.0.0.0 npm run serve -- --build --port 80 --host 0.0.0.0

View file

@ -164,7 +164,7 @@ export default function VisitMyWebsiteMessage() {
When [localizing your site](./i18n/i18n-introduction.md), the `<Translate/>` component will allow providing **translation support to React components**, such as your homepage. The `<Translate>` component supports [interpolation](#interpolate). When [localizing your site](./i18n/i18n-introduction.md), the `<Translate/>` component will allow providing **translation support to React components**, such as your homepage. The `<Translate>` component supports [interpolation](#interpolate).
The translation strings will be extracted from your code with the [`docusaurus write-translations`](./cli.md#docusaurus-write-translations) CLI and create a `code.json` translation file in `website/i18n/<locale>`. The translation strings will be extracted from your code with the [`docusaurus write-translations`](./cli.md#docusaurus-write-translations-sitedir) CLI and create a `code.json` translation file in `website/i18n/<locale>`.
:::note :::note

View file

@ -88,7 +88,7 @@ export default function Home() {
### Initialize the `i18n` folder {#initialize-the-i18n-folder} ### Initialize the `i18n` folder {#initialize-the-i18n-folder}
Use the [write-translations](../cli.md#docusaurus-write-translations) CLI command to initialize the JSON translation files for the French locale: Use the [write-translations](../cli.md#docusaurus-write-translations-sitedir) CLI command to initialize the JSON translation files for the French locale:
```bash npm2yarn ```bash npm2yarn
npm run write-translations -- --locale fr npm run write-translations -- --locale fr
@ -157,7 +157,7 @@ To keep your translated sites consistent, when the `website/docs/doc1.md` doc is
### JSON translations {#json-translations} ### JSON translations {#json-translations}
To help you maintain the JSON translation files, it is possible to run again the [write-translations](../cli.md#docusaurus-write-translations) CLI command: To help you maintain the JSON translation files, it is possible to run again the [write-translations](../cli.md#docusaurus-write-translations-sitedir) CLI command:
```bash npm2yarn ```bash npm2yarn
npm run write-translations -- --locale fr npm run write-translations -- --locale fr

View file

@ -122,7 +122,7 @@ website/i18n
└── navbar.json └── navbar.json
``` ```
The JSON files are initialized with the [`docusaurus write-translations`](../cli.md#docusaurus-write-translations) CLI command. The JSON files are initialized with the [`docusaurus write-translations`](../cli.md#docusaurus-write-translations-sitedir) CLI command.
The `code.json` file is extracted from React components using the `<Translate>` API. The `code.json` file is extracted from React components using the `<Translate>` API.