After upgrading to v0.123.x, Hugo seems to be using anchorize rather than urlize when creating urls for term pages.
Given the following categories:
Things & Other things
Best & Worst of Times
Articles & News
This & That
Hugo v0.119.0 generates the following relative URLs
/categories/articles-news/
/categories/best-worst-of-times/
/categories/things-other-things/
/categories/this-that/
However v0.123.6 generates the following (note the extra double hyphens in place of &):
/categories/articles--news/
/categories/best--worst-of-times/
/categories/things--other-things/
/categories/this--that/
Reproduction:
git clone --single-branch -b anchorized-category-urls https://github.com/alanbreck/hugo-testing anchorized-category-urls
cd anchorized-category-urls
rm -rf public && hugo
Either 301 redirects server-side, or generate content pages (as needed) with “aliases” in front matter. I guess on some sites it could affect every term, but on most sites it’s probably a subset.
@bep Please confirm that this (see my previous comment) was an intentional change. It probably doesn’t affect that many URLs in the wild, but redirects are required.
Related to the issue of understanding what the precise behavior will be, does it use anchorize or urlize under the hood? At first glance, it appears that it does not since hyphens are added for whitespace, but . is preserved.
Please create an issue in the docs repository. I think this should be about Page.RelPermalink and Page.Permalink… what we’re talking about in this issue is not specific to taxonomy or term pages. The revised documentation should describe the relationship between the content’s file path (or logical path when the content is not backed by a file) and the published URL.
Also note https://github.com/gohugoio/hugoDocs/issues/2307. The concepts referenced/described in the affected pages need to consolidated. It’s a bit of a mess right now, so I’d like to limit the proposed docs change to the Permalink/RelPermalink pages. #2307 is a few days of work, so it’s not going to happen tomorrow.