Hugo 0.62.2: A couple of Bug Fixes
The main driving force behind these patch releases in the new year has been getting a good story with portable links between GitHub and Hugo, using the new render hooks introduced in Hugo 0.62.0. And all was mostly well until a Hugo user asked about anchor links. Which is, when you look into it, a slightly sad Markdown story. They have been talking about anchors in Markdown over at the CommonMark forum for the last six years, but it has come to nothing. The current situation is that some Markdown engines support the {#anchorName}
attribute syntax (Hugo’s Goldmark does, GitHub does not) and for those that support auto-generation of IDs, the implementation often varies. And this makes for poor portability.
To improve this, Hugo has now reverse-engineered GitHub’s implementation and made that the default strategy for generation or header IDs. We understand that this isn’t everyone’s cup of tea, so you can configure the behaviour to be one of github
, github-ascii
(some client-libraries have Unicode issues) or blackfriday
(which will match how it behaved before Hugo 0.60).
- hugolib: Fix relative .Page.GetPage from bundle 196a9df5 @bep #6705
- markup/goldmark: Adjust auto ID space handling 9b6e6146 @bep #6710
- docs: Document the new autoHeadingIDType setting d62ede8e @bep #6707#6616
- docs: Regenerate docshelper 81b7e48a @bep #6707#6616
- markup/goldmark: Add an optional Blackfriday auto ID strategy 16e7c112 @bep #6707
- markup/goldmark: Make the autoID type config a string 8f071fc1 @bep #6707
- markup/goldmark: Simplify code 5ee1f087 @bep
- markup/goldmark: Make auto IDs GitHub compatible a82d2700 @bep #6616
Improve this page