Hi!
I am making a website in Hugo [v0.88.1] and it has 2 languages (en and pt-pt) and 2 sections (blog and projects).
I wanted to use two taxonomies: categories and time (YYYY-MM of publication date). And wanted both to be specific to the blog section (not for projects section) and both taxonomies’ terms and values should show up in the path “/blog/”, like this:
Path to terms in taxonomies “categories” and “time” of blog:
Path to the values in a taxonomy term “categories” and “time” of blog:
Portuguese paths would be similar but preceded by /pt-pt/. Example:
So in the config.yaml I set the following (for simplicity showing only the english version):
#config.yaml
taxonomies:
category: "blog/categories"
time: "blog/time"
permalinks:
categories: "/blog/categories/:title/"
time: "/blog/time/:title/"
I set the taxonomies name “blog/categories” and “blog/time” because I noticed that this automatically creates the pages in the correct paths “http://localhost/blog/categories/” and “http://localhost/blog/time/”, respectively.
However, now I am having difficulties in using functions such as:
{{ range .Site.Taxonomies.**blog/categories**.Alphabetical }}
My question is:
- Can I use special characters in taxonomy names like the “/” in “blog/categories”?
- If so how do I then insert the taxonomy name in functions such as
{{ range .Site.Taxonomies.blog/categories.Alphabetical }}
? - If you do not recommend the use of special characters in taxonomy names (e.g.: “blog/categories”) how do I get Hugo to understand that all terms (i.e. lists terms of taxonomy) and taxonomy pages (i.e. lists values of taxonomy term) should be in a path under blog (i.e. “http://localhost/blog/categories/” and “http://localhost/blog/time/”?
Additional Info
- I am using translation by filename for multilingual capabilities
- I am using page bundles
I hope I was clear. I am having difficulties understanding the template structure and lookup order in Hugo, as well as what is the use of having taxonomy singular and plural… Things get weirder if I wished to have distinct taxonomies for two sections separately.
Thank you!