0

I seek to add tags and categories to the default blogdown theme (hugo-lithium theme).

As a first step, config.toml is configured to include Categories and Tags links in the theme's main menu:

[[menu.main]]
    name = "Categories"
    url = "/categories/"
    weight = 2
[[menu.main]]
    name = "Tags"
    url = "/tags/"
    weight = 3

Clicking the Categories link displays:

Index of ./categories/ 
Name    Size    Date Modified 
./              2017-09-15 09:55:53 
../             2017-09-16 22:03:12 
r/              2017-09-15 09:55:53 
index.xml  695 B    2017-09-17 14:25:01 

Clicking the Tags links displays:

Index of ./tags/
Name    Size    Date Modified
./              2017-09-15 15:31:46
../             2017-09-16 22:03:12
aws/            2017-09-15 15:31:46
openemr/        2017-09-15 15:31:46
plot/           2017-09-15 09:55:53
r-markdown/     2017-09-15 09:55:53
regression/     2017-09-15 09:55:53
index.xml  1,199 B  2017-09-17 14:36:01

A better user experience is sought for manipulating the bog via Categories and Tags. I know it exists as I've seen it in other themes.

I understand the problem to be that the template for taxonomies (terms.html) is not in the theme, so the index pages will not be generated (e.g., tags/index.html).

How would one go about adding the template for taxonomies (terms.html) to the theme for a reasonable user for subsetting blog posts listings by categories and tag?

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
John Williams
  • 75
  • 1
  • 1
  • 8
  • Posted related question here: https://stackoverflow.com/questions/71133170/add-tags-to-post-summaries-of-lithium-themed-hugo-blogdown-website asking how to get tags to show-up on summaries/previews of posts. – Bryan Shalloway Feb 15 '22 at 20:46

1 Answers1

4

For the record, this question has been cross-posted on Github.

The hugo-lithium-theme does not have the template for taxonomies (terms.html), so the index pages will not be generated (e.g., tags/index.html). If you want to add it, I recommend you to spend some time on learning more about Hugo themes and templates in the blogdown book: https://bookdown.org/yihui/blogdown/templates.html, and add the template terms.html to the _default/ folder.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419