HUGO

What's the concept of the categories taxonomy?

Two taxonomies are provided by default, tags and categories. I understand tags and find them very helpful - almost an essential feature for a blog site. However, I’m wondering what the purpose of the “categories” is.

Can someone explain or give examples? It seems to me I can do all the categorization I need with just sections, tags and an authors taxonomy that I added. But I’d like to use categories too if it would make the site better.

If it’s unnecessary for a particular site owner, is it harmless to just comment out the “categories” taxonomy?

1 Like

My understanding is that neither ‘tags’ nor ‘categories’ are provided by ‘default’. They are simply examples of possible taxonomies used in the documentation. There is no functional difference between them or any other taxonomy. As long as they are not named in your frontmatter or config file they won’t appear anywhere.

Of course my understanding may be completely wrong … :wink:

1 Like

I tried to make this a bit clearer in the newer docs (i.e., the docs concept currently being developed). Please see here:

Thanks, I just commented it in the config, and it disappeared from the list of them - I hadn’t made templates for it anyway- and apparently no ill effects.

Still wondering whether people do use it, in case I’m missing something, but it’s unimportant now.

The docs have been enough for me to find how to do almost everything so far!

1 Like

I would say that categories are the general classification of an article, while tags are a grab-bag of ephemeral keywords that people might search through. Sections, on the other hand, are a there-can-be-only-one organizational tool that affects the URL and determines things like which RSS feed an article appears in.

So, for instance, /reviews is a section, “Doctor Who” is a category, and “season 10”, “spoilers”, and “plot holes” are tags. An article in a separate section called /fanart could be in both the “Doctor Who” and “My Little Pony” categories, tagged “bill potts” and “twilight sparkle”.

You might not need all three, but they can be used to organize a large site. Personally, when I migrated thousands of entries over from MovableType, I made each blog a section, made a 1:1 mapping of the old categories from the primary blog to Hugo categories, and was surprised to discover that I had actually used tags for the first several years, until I got tired of typing them in.

Since I added Xapian Omega as a search back-end a few days ago, I don’t see any reason to re-tag the old posts and start tagging new ones by hand. Broad categories are sufficient for organizing articles, and anyone who wants to find out what I think of Peter Capaldi as Doctor Who can just hit the search button in the navbar. That’s generally more useful than manual tagging.

-j

It is a bit clearer, but perhaps it should be explicitly stated that the words ‘tags’ and ‘categories’ are simply possible names for your taxonomies that have no inherent functional difference in Hugo - i.e. they’re both just lists of stuff that could be called anything. This is potentially confusing especially for people coming from Wordpress where ‘tags’ and ‘categories’ do have a specific meanings and different functionality. Categories being potentially hierarchical and only available on posts where tags are available on both posts and pages and are typically used in a more ad-hoc ‘folksonomy’ manner.

Another question entirely, but perhaps Hugo should support hierarchical taxonomies as a pendant to the much anticipated hierarchical sections … ?

jgreely’s explanation makes sense to me - a categories taxonomy sort of adds another dimension in case you need something more definite than tags and narrower than section - one kind of blog posts vs. another, tho they are all under /blog, or similar situation, as jgreely describes.

For my purposes I have enough dimensions with an “authors” taxonomy added.

I’m not ready to propose a change in Hugo, before getting a more thorough understanding, but my leading candidate right now would be making a author a first-class attribute of each page, the way ‘date’ and ‘title’ are now. There seems to have been a design assumption that a whole site would be writings of a single individual or organization.

It is. You have to read the entire page, which includes an introduction to what the term taxonomy means in the context of Hugo :smile:

I’ve read that page several times and I will still claim that is not explicitly stated that the words ‘tags’ and ‘categories’ do not have any special meaning, nor function like they do in Wordpress. It is certainly implicit in the text which on the whole is a model of clarity.

Never overestimate your readers’ intelligence (at least not this reader) nor underestimate their penchant for pedantry … :wink:

@bluefuzz Glad you go it figured out :smile:

2 posts were split to a new topic: Are taxonomies created by default?

Just leaving this here, since this is where the terms seem to have been derived from as suggested in the thread. From my understanding, there is no difference in terms of hugo’s functionality.