Dual footnotes

Which way is the most appropriate when it comes to organising out-of-document links and footnotes (which can be regarded as in-document links)?

Some tips from here and there in combination with some tweaking and testing has proven (at least in my setup), that it’s possible to add both internal and external links to a document in a way, where links and footnotes are kept separated from the text in which they belong.

Ordinary footnotes [^1] etc. work fine when converted to html with Hugo’s underlying Blackfriday-utility. But it’s possible to organise (and reuse) out-of-doc links in the same manner by skipping the triangle [1].

However the two systems collide, when you use numbers in both. Luckily it turns out, that the out-of-doc links survive a switch to letters. So you can create two independent and cronological lists.

Conclusion: By using the logic from the sample below it’s possible to keep all footnotes and links at the bottom of the markdown-document as a pool of extra info to use from.

Extra advantage: This separation also makes maintaining of bonus info easier, as you only need to update a link or a reference in one place, when it may be in use multiple times across the document.

Furthermore this approach makes markdown-content easier to export (and perhaps exchange) with other systems.

At least thats what appeals to a structure-freak like me. Hope there are others out there.

Somewhere in the middle of the markdown document:

This is a normal footnote, which directs to the bottom of the document. [^1]
This is a dual footnote, which also reuses the url from the footnote for a hyperlink [more on markdown] [A] [^2]

At the bottom om the document:

[^1]: Here goes the normal footnote, which is used inside the text above.
[^2]: And here the dual footnote, which beside the footnote (link to the bottom) also contains a link out of document including text mouseover (optional).

[A]: https://markdown.dk/ "Here is some optional mouseover text"
1 Like

I’m a structure freak too :smile:, so this is really great stuff.

I’m a big fan of using the [id] syntax in markdown and keeping everything at the bottom since it makes future changes that much easier.

Here is a link to a [page on monkeys][monkeys]. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque cumque provident, sit quod tempore pariatur dolore incidunt, voluptatem asperiores quas quo hic ea animi omnis accusamus esse molestiae earum distinctio? As far as [monkey dietary restrictions][monkey] are concerning, blah blah blah.

[monkeys]: /my-page-on-monkeys/

One thing to note with your tip/trick is that images can use a similar syntax:

![Photography of an adorable baby monkey.][1]


[1]: /images/baby-monkey.jpg

If I may be so bold, I’d recommend retitling this thread to “Markdown Syntax Tip: Dual Footnotes” since it really has very little to do with Hugo and everything to do with MD syntax in general. Thanks for submitting this!

I had recently come across the same issue. I chose to change the footnote naming convention instead: [^fn:1], and it works :slight_smile: