Back to Hugo

urls.Anchorize

docs/content/en/functions/urls/Anchorize.md

0.161.1733 B
Original Source

{{% include "/_common/functions/urls/anchorize-vs-urlize.md" %}}

Sanitizing logic

With the default Markdown renderer, Goldmark, the sanitizing logic is controlled by your project configuration:

{{< code-toggle file=hugo >}} [markup.goldmark.parser] autoHeadingIDType = 'github' {{< /code-toggle >}}

This controls the behavior of the anchorize function and the generation of heading IDs when rendering Markdown to HTML.

Set autoHeadingIDType to one of:

github : Compatible with GitHub. This is the default.

github-ascii : Similar to the github setting, but removes non-ASCII characters.

blackfriday : Provided for backwards compatibility with Hugo v0.59.1 and earlier. This option will be removed in a future release.