So I have this very specific need: removing accents from generated anchors with Hugo.
To my knowledge, there is no accent in English, but other languages contain plenty of them.
For example, in French, it gives:
<h2 id="#les-frameworks-de-r%C3%A9f%C3%A9rence">
The problem is that if you use {{ .TableOfContents }} to generate a table of contents for your posts, anchors have to be exactly same as those generated in {{ .Content }}.
Therefore, it's not possible to manually filter headings or override them in layouts.
This global configuration seems effective:
[markup]
[markup.goldmark]
[markup.goldmark.parser]
autoHeadingIDType = 'github-ascii'
This config is similar to the default autoHeadingIDType (github), but it removes non-ASCII characters.
Now, I get:
<h2 id="#les-frameworks-de-reference">
Top comments (0)