mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 21:03:47 +02:00
docs: document doc tags + refinements (#5433)
* Various improvements Signed-off-by: Josh-Cena <sidachen2003@gmail.com> * Oops Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
parent
49c5f3ed41
commit
1481bc2eb7
2 changed files with 27 additions and 6 deletions
|
@ -181,7 +181,8 @@ Blog post authors can be declared directly inside the FrontMatter:
|
||||||
values={[
|
values={[
|
||||||
{label: 'Single author', value: 'single'},
|
{label: 'Single author', value: 'single'},
|
||||||
{label: 'Multiple authors', value: 'multiple'},
|
{label: 'Multiple authors', value: 'multiple'},
|
||||||
]}>
|
]}
|
||||||
|
groupId="author-frontmatter">
|
||||||
<TabItem value="single">
|
<TabItem value="single">
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```yml title="my-blog-post.md"
|
||||||
|
@ -225,6 +226,7 @@ This option works best to get started, or for casual, irregular authors.
|
||||||
|
|
||||||
Prefer usage of the `authors` FrontMatter, but the legacy `author_*` FrontMatter remains supported:
|
Prefer usage of the `authors` FrontMatter, but the legacy `author_*` FrontMatter remains supported:
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
```yml title="my-blog-post.md"
|
```yml title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
author: Joel Marcey
|
author: Joel Marcey
|
||||||
|
@ -232,8 +234,8 @@ author_title: Co-creator of Docusaurus 1
|
||||||
author_url: https://github.com/JoelMarcey
|
author_url: https://github.com/JoelMarcey
|
||||||
author_image_url: https://github.com/JoelMarcey.png
|
author_image_url: https://github.com/JoelMarcey.png
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
```
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
@ -271,7 +273,8 @@ In blog posts FrontMatter, you can reference the authors declared in the global
|
||||||
values={[
|
values={[
|
||||||
{label: 'Single author', value: 'single'},
|
{label: 'Single author', value: 'single'},
|
||||||
{label: 'Multiple authors', value: 'multiple'},
|
{label: 'Multiple authors', value: 'multiple'},
|
||||||
]}>
|
]}
|
||||||
|
groupId="author-frontmatter">
|
||||||
<TabItem value="single">
|
<TabItem value="single">
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```yml title="my-blog-post.md"
|
||||||
|
@ -302,6 +305,7 @@ The `authors` system is very flexible and can suit more advanced use-case:
|
||||||
|
|
||||||
You can use global authors most of the time, and still use inline authors:
|
You can use global authors most of the time, and still use inline authors:
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
```yml title="my-blog-post.md"
|
```yml title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
authors:
|
authors:
|
||||||
|
@ -312,16 +316,17 @@ authors:
|
||||||
url: https://github.com/inlineAuthor
|
url: https://github.com/inlineAuthor
|
||||||
image_url: https://github.com/inlineAuthor
|
image_url: https://github.com/inlineAuthor
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
```
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Local override of global authors</summary>
|
<summary>Local override of global authors</summary>
|
||||||
|
|
||||||
You can customize the global author's data on per-blog-post basis
|
You can customize the global author's data on per-blog-post basis:
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
```yml title="my-blog-post.md"
|
```yml title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
authors:
|
authors:
|
||||||
|
@ -330,8 +335,8 @@ authors:
|
||||||
- key: slorber
|
- key: slorber
|
||||||
name: Sébastien Lorber's new name
|
name: Sébastien Lorber's new name
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
```
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
|
@ -83,3 +83,19 @@ With <code>{#custom-id}</code> syntax you can set your own header id.
|
||||||
|
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Doc tags {#doc-tags}
|
||||||
|
|
||||||
|
Optionally, you can add tags to your doc pages, which introduces another dimension of categorization in addition to the [docs sidebar](./sidebar.md). Tags are passed in the front matter as a list of labels:
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
```yml "your-doc-page.md"
|
||||||
|
---
|
||||||
|
id: doc-with-tags
|
||||||
|
title: A doc with tags
|
||||||
|
tags:
|
||||||
|
- Demo
|
||||||
|
- Getting started
|
||||||
|
---
|
||||||
|
```
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue