mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 22:46:57 +02:00
feat(docs, blog): add support for tags.yml
, predefined list of tags (#10137)
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: OzakIOne <OzakIOne@users.noreply.github.com> Co-authored-by: sebastien <lorber.sebastien@gmail.com> Co-authored-by: slorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
1049294ba6
commit
0eb7b64aac
63 changed files with 2597 additions and 722 deletions
|
@ -60,16 +60,32 @@ The [front matter](../markdown-features/markdown-features-intro.mdx#front-matter
|
|||
|
||||
## 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/index.mdx). Tags are passed in the front matter as a list of labels:
|
||||
Tags are declared in the front matter and introduce another dimension of categorization in addition to the [docs sidebar](./sidebar/index.mdx).
|
||||
|
||||
```md "your-doc-page.md"
|
||||
It is possible to define tags inline, or to reference predefined tags declared in a [`tags file`](../../api/plugins/plugin-content-docs.mdx#tags-file) (optional, usually `docs/tags.yml`).
|
||||
|
||||
In the following example:
|
||||
|
||||
- `docusaurus` references a predefined tag key declared in `docs/tags.yml`
|
||||
- `Releases` is an inline tag, because it does not exist in `docs/tags.yml`
|
||||
|
||||
```md title="docs/my-doc.md"
|
||||
---
|
||||
id: doc-with-tags
|
||||
title: A doc with tags
|
||||
tags:
|
||||
- Demo
|
||||
- Getting started
|
||||
- Releases
|
||||
- docusaurus
|
||||
---
|
||||
|
||||
# Title
|
||||
|
||||
Content
|
||||
```
|
||||
|
||||
```yml title="docs/tags.yml"
|
||||
docusaurus:
|
||||
label: 'Docusaurus'
|
||||
permalink: '/docusaurus'
|
||||
description: 'Docs related to the Docusaurus framework'
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue