docs: make config tabs translatable, fix APITable crowdin issue (#7572)

* docs: make config tabs translatable, fix APITable crowdin issue

* fix
This commit is contained in:
Joshua Chen 2022-06-06 10:52:19 +08:00 committed by GitHub
parent f8163ff2ee
commit bf9b69cfbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 263 additions and 156 deletions

View file

@ -35,7 +35,9 @@ npm install --save @docusaurus/plugin-client-redirects
Accepted fields:
```mdx-code-block
<APITable>
```
| Option | Type | Default | Description |
| --- | --- | --- | --- |
@ -44,7 +46,9 @@ Accepted fields:
| `redirects` | <code><a href="#RedirectRule">RedirectRule</a>[]</code> | `[]` | The list of redirect rules. |
| `createRedirects` | <code><a href="#CreateRedirectsFn">CreateRedirectsFn</a></code> | `undefined` | A callback to create a redirect rule. |
```mdx-code-block
</APITable>
```
### Types {#types}

View file

@ -33,7 +33,9 @@ You can configure this plugin through the [preset options](#ex-config-preset).
Accepted fields:
```mdx-code-block
<APITable>
```
| Name | Type | Default | Description |
| --- | --- | --- | --- |
@ -71,7 +73,9 @@ Accepted fields:
| `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. |
```mdx-code-block
</APITable>
```
### Types {#types}
@ -174,7 +178,9 @@ Markdown documents can use the following Markdown front matter metadata fields,
Accepted fields:
```mdx-code-block
<APITable>
```
| Name | Type | Default | Description |
| --- | --- | --- | --- |
@ -195,7 +201,9 @@ Accepted fields:
| `image` | `string` | `undefined` | Cover or thumbnail image that will be used when displaying the link to your post. |
| `slug` | `string` | File path | Allows to customize the blog post url (`/<routeBasePath>/<slug>`). Support multiple patterns: `slug: my-blog-post`, `slug: /my/path/to/blog/post`, slug: `/`. |
```mdx-code-block
</APITable>
```
```ts
type Tag = string | {label: string; permalink: string};

View file

@ -27,7 +27,9 @@ You can configure this plugin through the preset options.
Accepted fields:
```mdx-code-block
<APITable>
```
| Name | Type | Default | Description |
| --- | --- | --- | --- |
@ -62,7 +64,9 @@ Accepted fields:
| `onlyIncludeVersions` | `string[]` | All versions available | Only include a subset of all available versions. |
| `versions` | <a href="#VersionsConfig"><code>VersionsConfig</code></a> | `{}` | Independent customization of each version's properties. |
```mdx-code-block
</APITable>
```
### Types {#types}
@ -257,7 +261,9 @@ Markdown documents can use the following Markdown front matter metadata fields,
Accepted fields:
```mdx-code-block
<APITable>
```
| Name | Type | Default | Description |
| --- | --- | --- | --- |
@ -283,7 +289,9 @@ Accepted fields:
| `draft` | `boolean` | `false` | A boolean flag to indicate that a document is a work-in-progress. Draft documents will only be displayed during development. |
| `last_update` | `FileChange` | `undefined` | Allows overriding the last updated author and/or date. Date can be any [parsable date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). |
```mdx-code-block
</APITable>
```
```ts
type Tag = string | {label: string; permalink: string};

View file

@ -27,7 +27,9 @@ You can configure this plugin through the preset options.
Accepted fields:
```mdx-code-block
<APITable>
```
| Name | Type | Default | Description |
| --- | --- | --- | --- |
@ -41,7 +43,9 @@ Accepted fields:
| `beforeDefaultRemarkPlugins` | `any[]` | `[]` | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins. |
| `beforeDefaultRehypePlugins` | `any[]` | `[]` | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins. |
```mdx-code-block
</APITable>
```
### Example configuration {#ex-config}

View file

@ -68,8 +68,8 @@ Most Docusaurus users configure this plugin through the preset options.
:::
```mdx-code-block
<Tabs>
<TabItem value="Preset Options">
<Tabs groupId="api-config-ex">
<TabItem value="preset" label="Preset options">
```
If you use a preset, configure this plugin through the [preset options](../../using-plugins.md#docusauruspreset-classic):
@ -90,7 +90,7 @@ module.exports = {
```mdx-code-block
</TabItem>
<TabItem value="Plugin Options">
<TabItem value="plugin" label="Plugin Options">
```
If you are using a standalone plugin, provide options directly to the plugin:

View file

@ -33,14 +33,18 @@ You can configure this plugin through the preset options.
Accepted fields:
```mdx-code-block
<APITable>
```
| 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. |
```mdx-code-block
</APITable>
```
### Example configuration {#ex-config}

View file

@ -39,14 +39,18 @@ You can configure this plugin through the preset options.
Accepted fields:
```mdx-code-block
<APITable>
```
| 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. |
```mdx-code-block
</APITable>
```
### Example configuration {#ex-config}

View file

@ -40,7 +40,9 @@ import thumbnail from './path/to/img.png';
Accepted fields:
```mdx-code-block
<APITable>
```
| Option | Type | Default | Description |
| --- | --- | --- | --- |
@ -53,7 +55,9 @@ Accepted fields:
| `quality` | `number` | `85` | JPEG compression quality |
| `disableInDev` | `boolean` | `true` | You can test ideal image behavior in dev mode by setting this to `false`. **Tip**: use [network throttling](https://www.browserstack.com/guide/how-to-perform-network-throttling-in-chrome) in your browser to simulate slow networks. |
```mdx-code-block
</APITable>
```
### Example configuration {#ex-config}

View file

@ -33,7 +33,9 @@ You can configure this plugin through the [preset options](#ex-config-preset).
Accepted fields:
```mdx-code-block
<APITable>
```
| Name | Type | Default | Description |
| --- | --- | --- | --- |
@ -42,7 +44,9 @@ Accepted fields:
| `ignorePatterns` | `string[]` | `[]` | A list of glob patterns; matching route paths will be filtered from the sitemap. Note that you may need to include the base URL in here. |
| `filename` | `string` | `sitemap.xml` | The path to the created sitemap file, relative to the output directory. Useful if you have two plugin instances outputting two files. |
```mdx-code-block
</APITable>
```
:::info