Best strategy for taxonomy single and list pages

Hi,

New to this, but work on my Hugo site and blog is progressing.

What is the best strategy for creating taxonomy single and list pages?

On Pakstech Blog the strategy is to create a taxonomy (single) and terms (list) page per taxonomy, for example:

  • layouts/categories/taxonomy.html
  • layouts/categories/terms.html

In the excellent book Build Websites with Hugo by Brian P. Hogan, he uses the following strategy:

  • layouts/_default/categories.html (list of posts for a given category)
  • layouts/_default/tags.html (list of posts for a given tag)
  • layouts/_default/terms.html (list of categories or tags)

Are there other strategies? I don’t think it really matters for my site/blog, because I can change it afterwards, but which one is the best strategy? Not only for myself, but also if I want to make my theme publicly available.

Thanks.

You know that old coding adage, premature optimisation is the root of all evil?

I’ve actually gotten away with not doing separate pages for these and just use a single standardised list template for all list-y pages. This won’t work for everyone, of course, it’ll depend on your site, but if you don’t need to go and make extra templates, there’s no real reason to make more work for yourself in advance. You can easily enough add more specific templates later as and when you need them.

So, all I’m trying to say is “best” depends on you and your individual site you’re building.

1 Like