Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Restore 0.48 slash handling in taxonomies #5571
To me, taxonomies are the main reason, why Hugo stands out from other static site generators. And the ability to handle multi-level taxonomies inly widens the gap.
The latter, I use in a three level geo-tagging (country/region/city) - further reading - example node:
Unfortunately, this feature is no longer available. From Hugo 0.48 all slashes in taxonomies seem to be replaced by dashes.
At least that's what happens in the example node, which no longer gets updated at the old url with slashes. Now the example node above is rendered at:
Hence, no more browsing down the hierarchy from posts about a country to posts about a region in the same country and further to a selected city in that region.
In this post multi-level taxonomies with slashes are considered a "hack". Hence Hugo 0.48 fixes this.
But in my opinion, slashes in taxonomies are not a hack. They are awesome!
I would argue, there is a use case for both:
A suggestion would be to add a setting - say
Otherwise I'll have to revert to Hugo 0.47 and use this version permanently.
Issue #5513 certainly presents a workaround to keep using slashes in Hugo taxonomies. I may have missed something, but I'm not able to see, how this hack would bring back a narrowing hierarchy with
As lined out in this post the hard point is to narrow the number of posts when jumping from the country-index to the region-index and down to the city-index.
All index-stuff from the three levels resides in separated folders:
It's the node-indexes, that ties those levels together, so the user doesn't experience those jumps but gets a "zoom-like" experience going from country to region and to city.
In order to make this hierarchy work on the outside, node-indexes have to be positioned precisely in the right subfolder. This again requires, that slashes in a taxonomy are NOT converted to dashes - but continue as slashes "with licence to" create the subfolders necessary on the webserver.
Bottomline: A narrowing hierarchy inside a single taxonomy seems to require slashes, that again get translated to directories on the server. I still don't see any alternative.