Search code examples
hugo

Hugo - Difference between tags and categories


Tags and categories are taxonomies that are automatically created by Hugo.

I do not understand what the difference is between tags and categories (besides their names). Also, do categories have the same function as organizing website pages in folders?


Solution

  • https://gohugo.io/content-management/taxonomies#configuring-taxonomies
    Is a great resource.
    But TLDR; there is no significant difference between categories and tags. They are arbitrary taxonomies.
    I could make:
    "fizzles: apples"
    "fizzles: Bannanas"
    and I would have a taxonomy page rendered for all apples and all bannanas. Note: If you are using a wordpress strict taxonomy hierarchy, you'll be confused.

    To address the additional comment: The folder structure under the /content/ folder represents your site hierarchy.

    I.e. /content/about-us/our-team/

    will literally be:

    www.yoursite.com/about-us/our-team/

    Taxonomies are a different grouping - i.e. lets say I have a lot of pages, whether blog and main site or both or whatever, and I have "category: drug-rehabilitation" - then those all get categorized together/taxonomy page is created.

    Hope that clarifies.