mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-04 03:42:34 +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={[
|
||||
{label: 'Single author', value: 'single'},
|
||||
{label: 'Multiple authors', value: 'multiple'},
|
||||
]}>
|
||||
]}
|
||||
groupId="author-frontmatter">
|
||||
<TabItem value="single">
|
||||
|
||||
```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:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
```yml title="my-blog-post.md"
|
||||
---
|
||||
author: Joel Marcey
|
||||
|
@ -232,8 +234,8 @@ author_title: Co-creator of Docusaurus 1
|
|||
author_url: https://github.com/JoelMarcey
|
||||
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={[
|
||||
{label: 'Single author', value: 'single'},
|
||||
{label: 'Multiple authors', value: 'multiple'},
|
||||
]}>
|
||||
]}
|
||||
groupId="author-frontmatter">
|
||||
<TabItem value="single">
|
||||
|
||||
```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:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
```yml title="my-blog-post.md"
|
||||
---
|
||||
authors:
|
||||
|
@ -312,16 +316,17 @@ authors:
|
|||
url: https://github.com/inlineAuthor
|
||||
image_url: https://github.com/inlineAuthor
|
||||
---
|
||||
|
||||
```
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<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"
|
||||
---
|
||||
authors:
|
||||
|
@ -330,8 +335,8 @@ authors:
|
|||
- key: slorber
|
||||
name: Sébastien Lorber's new name
|
||||
---
|
||||
|
||||
```
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
</details>
|
||||
|
||||
|
|
|
@ -83,3 +83,19 @@ With <code>{#custom-id}</code> syntax you can set your own header id.
|
|||
|
||||
</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