Hugo config permalinks - Taxonomy list page vs term page vs value page - Sanity check

As always, much appreciated for this codebase and this community.

I would like a sanity check on ensuring I did something in the best way.
I do understand their is a lot of communication on the subject of Taxonomies.

Nonetheless, here we go:

I have two taxonomies - e.g.:

country = countries
island = inslands

In the aruba.md
I put in front matter:

country: 
- aruba

island: 
- aruba

Fine.

So they will output to

/countries/aruba
/islands/aruba

Awesome.

In permalinks I decide to put:

[pemalinks]
islands = /we-deliver-to/islands/:slug
countries = /we-deliver-to/countries/:slug

Great:

/we-deliver-to/islands/aruba/
/we-deliver-to/countries/aruba/

EXCEPT:

/we-deliver-to/islands/ ← doesn’t exist
/we-deliver-to/countries/ ← doesn’t exist

these pages remain rendered at /countries/ and /islands/ respectively.

So in the markdown loaded for the islands and countries taxonomy pages, I put in front matter:

url: /we-deliver-to/islands/
and
url: /we-deliver-to/countries/

This works.

Urls are as I want them.

/we-deliver-to/countries/
/we-deliver-to/countries/aruba/
/we-deliver-to/islands/
/we-deliver-to/islands/aruba/

Buono.

But, am I doing this the Hugo way? Is there something I am missing in the permalinks config for example?

1 Like

This seems about right. There’s an open issue to allow permalink configuration of sections, but until then you need to use the url param in front matter. If your site is multilingual, use

url = 'foo'

instead of

url = '/foo'

https://gohugo.io/content-management/urls/#set-url-in-front-matter

3 Likes