-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore 0.48 slash handling in taxonomies #5571
Comments
Note that something like this would work: But I guess that would be unpractical for many levels. |
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. |
@JLKM I was just mentioning it; it's not working for 200 countries + regions, I see that. |
See gohugoio#5571 This reverts commit 9ce0a1f.
See gohugoio#4090 See gohugoio#5571 This reverts commit fff1325.
Just to eliminate any doubt: The recent reversion in 0.54 to subfolders generated by slashes in taxonomies works absolutely perfect. A unique and brilliant feature has been restored. Thanks for the good work. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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:
https://udvandrerne.dk/byer/danmark/midtjylland/sabro/
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:
https://udvandrerne.dk/byer/danmark-midtjylland-sabro/
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
preserveSlashesInTaxonomies: true/false
orreplaceSlashesInTaxonomies: true/false
, so that Hugo can deliver a perfect fit in both cases.Otherwise I'll have to revert to Hugo 0.47 and use this version permanently.
https://discourse.gohugo.io/t/multi-level-taxonomy/4888/11,
The text was updated successfully, but these errors were encountered: