Best practices for Taxonomies

Hi. I want to create a blog. I need the article to have a category and tags. Now i have this structure of my site:

Content
– _index.md
– custom-page1.md
– custom-page2.md
– blog:
---- category 1
------ _index.md
------ article-1-1.md
------ article-1-2.md
------ article-1-3.md
---- category 2
------ _index.md
------ article-2-1.md
------ article-2-2.md
------ article-2-3.md
---- category 3
------ _index.md
------ article-3-1.md
------ article-3-2.md
------ article-3-3.md

By default hugo make folder category like section.
And front-matter of my article:

+++
tags = ["tag1", "tag2"]
+++

How will be better? Register the category together with the tags for the article in the front-matter and remove the category folders, or leave it as it is? And how to write info for a category / tag if I will remove folders (with _index.md inside) ? Now I have it recorded in a file _index.md (file in folder “category 1”):

+++
title = "Category 1"
type = "subCategory"
+++

And how to range my categories? Now i have in _index.md some parameter and use it:

{{ range where .Site.Pages "Params.type" "subCategory" }}

But maybe there is a better way to do this?

1 Like