docs: avoid using nested mdx-code-block (#7543)

* docs: avoid using nested mdx-code-block

* fix
This commit is contained in:
Joshua Chen 2022-06-01 19:32:25 +08:00 committed by GitHub
parent b81f80d06a
commit 5cf6432e4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 68 deletions

View file

@ -192,9 +192,10 @@ Use the `authors` front matter field to declare blog post authors. An author sho
Blog post authors can be declared directly inside the front matter:
````mdx-code-block
```mdx-code-block
<Tabs groupId="author-front-matter">
<TabItem value="single" label="Single author">
<TabItem value="single" label="Single author">
```
```md title="my-blog-post.md"
---
@ -207,8 +208,10 @@ authors:
---
```
</TabItem>
<TabItem value="multiple" label="Multiple authors">
```mdx-code-block
</TabItem>
<TabItem value="multiple" label="Multiple authors">
```
```md title="my-blog-post.md"
---
@ -225,9 +228,10 @@ authors:
---
```
</TabItem>
```mdx-code-block
</TabItem>
</Tabs>
````
```
:::tip
@ -279,9 +283,10 @@ Use the `authorsMapPath` plugin option to configure the path. JSON is also suppo
In blog posts front matter, you can reference the authors declared in the global configuration file:
````mdx-code-block
```mdx-code-block
<Tabs groupId="author-front-matter">
<TabItem value="single" label="Single author">
<TabItem value="single" label="Single author">
```
```md title="my-blog-post.md"
---
@ -289,8 +294,10 @@ authors: jmarcey
---
```
</TabItem>
<TabItem value="multiple" label="Multiple authors">
```mdx-code-block
</TabItem>
<TabItem value="multiple" label="Multiple authors">
```
```md title="my-blog-post.md"
---
@ -298,9 +305,10 @@ authors: [jmarcey, slorber]
---
```
</TabItem>
```mdx-code-block
</TabItem>
</Tabs>
````
```
:::info
@ -394,9 +402,10 @@ The default reading time is able to accept additional options: `wordsPerMinute`
Use the callback for all your customization needs:
````mdx-code-block
```mdx-code-block
<Tabs>
<TabItem value="disable-per-post" label="Per-post disabling">
```
**Disable reading time on one page:**
@ -410,7 +419,9 @@ module.exports = {
showReadingTime: true,
// highlight-start
readingTime: ({content, frontMatter, defaultReadingTime}) =>
frontMatter.hide_reading_time ? undefined : defaultReadingTime({content}),
frontMatter.hide_reading_time
? undefined
: defaultReadingTime({content}),
// highlight-end
},
},
@ -429,8 +440,10 @@ hide_reading_time: true
This page will no longer display the reading time stats!
```
```mdx-code-block
</TabItem>
<TabItem value="passing-options" label="Passing options">
```
**Pass options to the default reading time function:**
@ -452,8 +465,10 @@ module.exports = {
};
```
```mdx-code-block
</TabItem>
<TabItem value="using-custom-algo" label="Using custom algorithms">
```
**Use a custom implementation of reading time:**
@ -475,9 +490,10 @@ module.exports = {
};
```
```mdx-code-block
</TabItem>
</Tabs>
````
```
:::