A Way to Compare Hugo’s Markup Languages (featuring inline footnotes)
Updated  2022-June-1

Page contents

News

Ongoing  According to Repology, the latest packaged Hugo is version newest packaged version of Hugo. To keep up with Hugo releases, see github.com/gohugoio/hugo/releases, discourse.gohugo.io/c/announcements, or twitter.com/@GoHugoIO.

2021-August-2  Published this evolving⁠[1] article.

Introduction

Thanks to Hugo’s .RenderString method, which was introduced in Hugo v0.62.0, it’s possible to use more than one of Hugo’s markup languages in the source of a single page. This means you can test features of Hugo’s markup languages without creating a separate file for each markup language.

 

Markdown tests: Inline footnotes in two Markdown flavors

To learn about Markdown footnotes, see the Footnotes👣 section of Infinite Ink’s Ordinary and Extraordinary Markdown. Some (not all) Markdown flavors support the following syntax for inline footnotes:

some text^[This is an inline footnote.]

In the source of the first two tests below, I use Infinite Ink’s renderas shortcode to test this syntax in the Markdown flavors supported by Hugo v0.100.0+.⁠[2][3]

 


Test 1: Goldmark-flavored Markdown

Source fragment

{{< renderas goldmark >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text^[This is an inline footnote.]

 


Test 2: Pandoc-flavored Markdown

Source fragment

{{< renderas pandoc >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text1


  1. This is an inline footnote.↩︎

 


Markdown conclusion

  • Pandoc-⁠flavored Markdown supports this inline footnote syntax.

  • Goldmark-flavored Markdown does not support this inline footnote syntax. It’s possible — but probably not likely — inline footnotes will be supported in a future version of Goldmark.

 

More tests: Inline footnotes in AsciiDoc and Org-⁠mode

Test 3: AsciiDoc

 

Source fragment

{{< renderas adoc >}}

some textfootnote:[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text[1]


1. This is an inline footnote.

 

💡
Test 4’s renderas argument can be ad, adoc, or asciidocext (but not asciidoc, which is a bug).

 


Test 4: Org-mode

To learn about Org-mode footnotes, see orgmode.org/manual/Creating-Footnotes.html.

 

Source fragment

{{< renderas org >}}

some text[fn:: This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text1


1

This is an inline footnote.

 

Overall conclusion

Three of the four markup languages tested above support inline footnotes.⁠👍

 

See also

Endnotes


1. Many Infinite Ink articles, including this one, are evergreen and regularly updated.
2. Starting with version 0.92.0, Hugo no longer supports Mmark-⁠flavored Markdown.
3. Starting with version 0.100.0, Hugo no longer supports Blackfriday-⁠flavored Markdown.

Comments and questions 📝 🤔 👎 👍

Your public comment or question might immediately improve this page or help me to (eventually) improve this page.