Zalgorithm

How the Hugo build process processes footnotes

Hugo uses Goldmark to render markdown to HTML. The Goldmark footnote extension (which is oddly the php-markdown footnotes extension) is enabled by default. The documentation at that link is good.

This is relevant to semantic search because footnotes need to be handled in embeddings.

How does Goldmark handle out of order footnotes?

Goldmark with the footnote extension doesn’t respect footnote labels at all. In the rendered HTML, the first footnote gets the label 1, the second footnote gets the label 2, etc., regardless of the footnote labels in the original markdown file. That means it’s not an issue to insert a footnote with the label 20 at a later time, in between footnotes labeled 3 and 4. Named footnote labels are also ignored, they just get replaced with numbers in the rendered HTML.

References

Hugo Documentation. “Configure markup.” https://gohugo.io/configuration/markup/.