My articles’s front matter may contain categories with names such as “A & B”:
categories: ["A & B", "C"]
Which causes Hugo to create folders with double dashes:
public/categories/a--b
This behavior is not present if the categories contain spaces or dashes:
categories: ["A B"]
public/categories/a-b
categories: ["A-B"]
public/categories/a-b
How can I fix it such that when categories do contain ‘&’, it still maintains the single dash in the directory output and link references? I tried the different Sanitization approaches as described in urls.Anchorize to no effect.
Thanks in advance.
$ hugo env
hugo v0.145.0+extended+withdeploy darwin/arm64 BuildDate=2025-02-26T15:41:25Z VendorInfo=brew
GOOS="darwin"
GOARCH="arm64"
GOVERSION="go1.24.0"
github.com/sass/libsass="3.6.6"
github.com/webmproject/libwebp="v1.3.2"
Does that mean there is no way to use an ampersand in a category? Or how would you create links to these categories when urlize creates a-b but the actual file is at a--b?