When I’m reading other people’s posts, I often click interesting links open as I find them, but Matt Webb’s post about printed QR codes in books got me thinking about how I’d often like to see a collected list of links in regular blog posts too, particularly if the article or post is a long one.

Terence Eden touches on this as well, in his post about non-fiction footnotes in ebooks - he’s actually complaining about footnotes being a relic from the days of printed text, but I’m a fan of the printed form at least. I like a giant list of references and notes to work your way through, or to refer back to.

I write almost exclusively in markdown nowadays and I’m used to the square-bracket-round-bracket way of linking; [here's an example](http://example.com), but you can also link in Reference Style like this:

In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends
of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to
eat: it was a [hobbit-hole][1], and that means comfort.

[1]: <https://en.wikipedia.org/wiki/Hobbit#Lifestyle> "Hobbit lifestyles"

You get a nice list of links at the end of your writing, as well as the overall piece being easier on the eye to read. I think I first encoutered reference style links via Stack Overflow in their editor:

Stack Overflow's reference style linking in their Q&A editor

This blog is made in Jekyll which has a really nice plugin architecture, and after my first successful bash making jekyll-lazy-gist-embedding plugin which was pretty much a straight copy of an existing plugin, I thought I’d have a go at producing one that can extract all the links in a post and then append them to the end of the article.

This piece from Starr Horne about generating subnavigation seemed to do the same kind of thing that I wanted - parse a post and store some data about it, for use by the liquid templates later.

Thanks to that, it was super easy to make jekyll-extract-links which you should see in action, at the very end of this post.

For each link in a post, the plugin saves the linking text, the full href and a tidied href, which has any campaign utm or Chrome deep text-fragment links removed, which can often make the URL pretty unreadable.