mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 11:36:53 +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
|
@ -380,6 +380,35 @@ An author, either declared through front matter or through the authors map, need
|
|||
|
||||
:::
|
||||
|
||||
## Blog post tags {#blog-post-tags}
|
||||
|
||||
Tags are declared in the front matter and introduce another dimension of categorization.
|
||||
|
||||
It is possible to define tags inline, or to reference predefined tags declared in a [`tags file`](api/plugins/plugin-content-blog.mdx#tags-file) (optional, usually `blog/tags.yml`).
|
||||
|
||||
In the following example:
|
||||
|
||||
- `docusaurus` references a predefined tag key declared in `blog/tags.yml`
|
||||
- `Releases` is an inline tag, because it does not exist in `blog/tags.yml`
|
||||
|
||||
```md title="blog/my-post.md"
|
||||
---
|
||||
title: 'My blog post'
|
||||
tags:
|
||||
- Releases
|
||||
- docusaurus
|
||||
---
|
||||
|
||||
Content
|
||||
```
|
||||
|
||||
```yml title="blog/tags.yml"
|
||||
docusaurus:
|
||||
label: 'Docusaurus'
|
||||
permalink: '/docusaurus'
|
||||
description: 'Blog posts related to the Docusaurus framework'
|
||||
```
|
||||
|
||||
## Reading time {#reading-time}
|
||||
|
||||
Docusaurus generates a reading time estimation for each blog post based on word count. We provide an option to customize this.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue