Category and tags

Mr.Hope ... 2021-3-6 Blog
  • Blog
  • Category
  • Tag
Less than 1 minute

You can configure category and tags for articles through frontmatter to make them appear in specific categories and tags pages.

# Category Settings

Just add category: <category name> to the frontmatter of the page, and the article will be automatically rendered in the list of the /category/<category name>/ category page.

For example, add this to a certain page:

---
category: HTML
---

Page content...
1
2
3
4
5

Then you can find it under the /category/HTML page.

Note

Please note that only one category can be set for an article. (V2 plan supports multiple categories of articles)

# Tags

Just add the tags array to the frontmatter of the page, and set the tag to which one or more articles belong, and the article will be automatically rendered in the list of the /tag/<tag name>/ tag page.

For example, add this in a certain page:

---
tags:
  - HTML
  - Web
---

Page content...
1
2
3
4
5
6
7

Then you can find it under the /tag/HTML and /tag/Web pages.

# View list

Besides directly accessing the corresponding link, the category and tag name will be displayed at the article information at the top of the article. You can click on it to navigate to the corresponding list to view the articles of the same category or tag.

Article Information

You can also select the category or tag tab in the sidebar of the blog homepage and select the corresponding item to enter the list.

Sidebar Tab

Last update: March 10, 2021 04:43
Contributors: Mr.Hope