Customize each category page by adding more content?

I have `/category/[topic]/’ page with a list of articles for that given page.
Now, I would like to add more content there - perhaps some descriptions, images etc.

Each category page would have quite different content and maybe even structure so likely I cant just go with one template, instead, I would prefer to have an ‘[category].md’ file with the content that I could feed into generation of the category pages for given topic. If there is no custom category content, then Hugo would just generate the page without it as usually.

How can I achieve it?

I’m not sure I understood correctly so correct me if I’m wrong.

Before anything else, so we are on the same page: /category/[topic]/ = /taxonomy/term/

I don’t think you can create a file to change a taxonomy. What you can do is create an file per term in /content/ and create a separate folder per taxonomy in /layouts/. Here’s an example:

  1. In your /content/ folder, create a folder for each of your term with an file in each. It should look like this:

    • Inside the file is where you place the frontmatter params, example:
      title = "Life"
      #aliases = [""]
      url = "cat/life"
      translationKey = "cat-life"
      headerimage = "some-link"
      description = "The quick brown fox jumps over a lazy dog."
  2. In your /layouts/ folder, create a folder for each of your taxonomy with a terms.html file each. It should look like this:


    This is where you should place all the code related to the design layout when the terms are displayed and use those frontmatter params defined in your files.

(There is probably a better way of doing the above.)

If you are asking if you can have a different design/layout for each term like so:

  • = different design
  • = different design
  • = different design
  • = different design

I’m not sure if it is possible, I have not encountered it and I haven’t tried it either.

To summarize:

  • /content/taxonomy/ is where you add frontmatter params.
  • /layouts/taxonomy/terms.html is where you code the design and use those params.

Hope it helps. Shalom!