{
 "blyg": "0.4",
 "id": "4y4agk5afryzjsq1xwnh2nrzem",
 "kind": "thread",
 "origin": "https://notionparallax.co.uk/",
 "page": "https://notionparallax.co.uk/2020/footnotes-for-print",
 "author": {
  "name": "Ben Doherty",
  "url": "https://notionparallax.co.uk/"
 },
 "created": "2020-06-13T15:45:00Z",
 "updated": "2020-06-13T15:45:00Z",
 "version": 1,
 "content_md": "# Printing hyperlinks nicely as footnotes\n\n\n[Walden Pond](https://waldenpond.press/) is full of content that was intended to go on the web. So there's all sorts of problems with how to make it usable in print. One of the most obvious is [hyperlinks](rickroll).\n\nThere are some really nice tricks that make what the link links to visible in print.\n\n<figure>\n```css\na:after {\n    content: \" [\" attr(href) \"] \";\n}\n```\n<figcaption>\nFrom <cite>[CSS tricks](https://css-tricks.com/css-tricks-finally-gets-a-print-stylesheet/#4-display-the-urls-in-the-body-content)</cite>\n</figcaption>\n\n</figure>\n\nWhich is cool if your links are nice looking, but sometimes the text has a tonne of links in it and you can end up with more link than content.\n\nIn Walden Pond I've put the links in as footnotes. So a superscript number in the text, and a numbered list of links at the end of the article. I'm using a slightly edited version of [Aaron Gustafson's](http://www.easy-designs.net/) [footnote code](https://gist.github.com/Sinetheta/6612205) (from 2005!).\n\nThis is great, but sometimes you'll get an article that uses a lot of long links. A prime offender is when the article recommends a lot of things with amazon referrer links, but it could be almost anything. For example, in the Wait But Why post [From Muhammad to ISIS: Iraq’s Full Story](https://waitbutwhy.com/2014/09/muhammad-isis-iraqs-full-story.html) there are 54 links, and a lot of them look like this:\n\n> https://www.ft.com/<wbr>content/<wbr>69e70954-f639-11e3-a038-00144feabdc0?%E2%80%94ftcamp=crm/email/<wbr>2014617/<wbr>nbe/<wbr>AsiaMorningHeadlines/<wbr>product#axzz3A20GKJTZ\n\nIn this case, the bit after the `?` is just tracking (_?%E2%80%94ftcamp=crm/email/<wbr>2014617/<wbr>nbe/<wbr>AsiaMorningHeadlines/<wbr>product#axzz3A20GKJTZ_) to tell the FT where the reader found the link. But in some cases, the URL params actually have useful information in them, so I can't just cut them off.\n\nWhat I've ended up doing is using [Firebase Dynamic links](https://firebase.google.com/docs/reference/dynamic-links/link-shortener) to shorten these links, so the FT link above becomes: `Hi1e`\n\nThat's sort of cheating because it's actually `https://pond.page.link/Hi1e` but the first part is the same for all the shortened links.\n\nThis means that people can either remember the `https://pond.page.link/` part and build their own links, or they can go to the [Walden Pond website](https://waldenpond.press/) and type it into the link-expander.\n\n<figure class=\"two-side-by-side\">\n![](https://notionparallax.co.uk/assets/20/Link-expander-in.png)![](https://notionparallax.co.uk/assets/20/Link-expander-out.png)\n\n</figure>\n\n<figure class=\"half-width right\">\n![some links in a list, some shortened, some not](https://notionparallax.co.uk/assets/20/shortened-links.png)\n\n<figcaption>\nThis figure is half-width and floated right\n\n</figcaption>\n\n</figure>\n\nOne problem with shortened links is that they're an extra layer of abstraction away. So you have no idea if `Hi1e` is taking you to the FT or to PornHub, or to _Best Number One Phishing Bank_. I've tried to get around that by only shortening links over 90 chars long, and then for the links I do shorten leaving the first part of the domain intact. Giving: `ft.com | Hi1e`.\n\nSometimes the link has an ID attached to it, so I've added that in too. Hopefully it's not too confusing, because without it, you can't see what the link points to because Firebase seems to strip off the #part of the url.\n",
 "content_html": "<h1>Printing hyperlinks nicely as footnotes</h1>\n<p><a href=\"https://waldenpond.press/\">Walden Pond</a> is full of content that was intended to go on the web. So there’s all sorts of problems with how to make it usable in print. One of the most obvious is <a href=\"https://notionparallax.co.uk/2020/rickroll\">hyperlinks</a>.</p>\n\n<p>There are some really nice tricks that make what the link links to visible in print.</p>\n\n<figure>\n  <div class=\"language-css highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nt\">a</span><span class=\"nd\">:after</span> <span class=\"p\">{</span>\n    <span class=\"nl\">content</span><span class=\"p\">:</span> <span class=\"s1\">\" [\"</span> <span class=\"n\">attr</span><span class=\"p\">(</span><span class=\"n\">href</span><span class=\"p\">)</span> <span class=\"s1\">\"] \"</span><span class=\"p\">;</span>\n<span class=\"p\">}</span>\n</code></pre></div>  </div>\n  <figcaption>\n    <p>From <cite><a href=\"https://css-tricks.com/css-tricks-finally-gets-a-print-stylesheet/#4-display-the-urls-in-the-body-content\">CSS tricks</a></cite></p>\n  </figcaption>\n\n</figure>\n\n<p>Which is cool if your links are nice looking, but sometimes the text has a tonne of links in it and you can end up with more link than content.</p>\n\n<p>In Walden Pond I’ve put the links in as footnotes. So a superscript number in the text, and a numbered list of links at the end of the article. I’m using a slightly edited version of <a href=\"http://www.easy-designs.net/\">Aaron Gustafson’s</a> <a href=\"https://gist.github.com/Sinetheta/6612205\">footnote code</a> (from 2005!).</p>\n\n<p>This is great, but sometimes you’ll get an article that uses a lot of long links. A prime offender is when the article recommends a lot of things with amazon referrer links, but it could be almost anything. For example, in the Wait But Why post <a href=\"https://waitbutwhy.com/2014/09/muhammad-isis-iraqs-full-story.html\">From Muhammad to ISIS: Iraq’s Full Story</a> there are 54 links, and a lot of them look like this:</p>\n\n<blockquote>\n  <p>https://www.ft.com/<wbr />content/<wbr />69e70954-f639-11e3-a038-00144feabdc0?%E2%80%94ftcamp=crm/email/<wbr />2014617/<wbr />nbe/<wbr />AsiaMorningHeadlines/<wbr />product#axzz3A20GKJTZ</p>\n</blockquote>\n\n<p>In this case, the bit after the <code class=\"language-plaintext highlighter-rouge\">?</code> is just tracking (<em>?%E2%80%94ftcamp=crm/email/<wbr />2014617/<wbr />nbe/<wbr />AsiaMorningHeadlines/<wbr />product#axzz3A20GKJTZ</em>) to tell the FT where the reader found the link. But in some cases, the URL params actually have useful information in them, so I can’t just cut them off.</p>\n\n<p>What I’ve ended up doing is using <a href=\"https://firebase.google.com/docs/reference/dynamic-links/link-shortener\">Firebase Dynamic links</a> to shorten these links, so the FT link above becomes: <code class=\"language-plaintext highlighter-rouge\">Hi1e</code></p>\n\n<p>That’s sort of cheating because it’s actually <code class=\"language-plaintext highlighter-rouge\">https://pond.page.link/Hi1e</code> but the first part is the same for all the shortened links.</p>\n\n<p>This means that people can either remember the <code class=\"language-plaintext highlighter-rouge\">https://pond.page.link/</code> part and build their own links, or they can go to the <a href=\"https://waldenpond.press/\">Walden Pond website</a> and type it into the link-expander.</p>\n\n<figure class=\"two-side-by-side\">\n  <p><img src=\"https://notionparallax.co.uk/assets/20/Link-expander-in.png\" alt=\"\" /><img src=\"https://notionparallax.co.uk/assets/20/Link-expander-out.png\" alt=\"\" /></p>\n\n</figure>\n\n<figure class=\"half-width right\">\n  <p><img src=\"https://notionparallax.co.uk/assets/20/shortened-links.png\" alt=\"some links in a list, some shortened, some not\" /></p>\n\n  <figcaption>\n    <p>This figure is half-width and floated right</p>\n\n  </figcaption>\n\n</figure>\n\n<p>One problem with shortened links is that they’re an extra layer of abstraction away. So you have no idea if <code class=\"language-plaintext highlighter-rouge\">Hi1e</code> is taking you to the FT or to PornHub, or to <em>Best Number One Phishing Bank</em>. I’ve tried to get around that by only shortening links over 90 chars long, and then for the links I do shorten leaving the first part of the domain intact. Giving: <code class=\"language-plaintext highlighter-rouge\">ft.com | Hi1e</code>.</p>\n\n<p>Sometimes the link has an ID attached to it, so I’ve added that in too. Hopefully it’s not too confusing, because without it, you can’t see what the link points to because Firebase seems to strip off the #part of the url.</p>\n",
 "content_hash": "sha256:a569c7ccc6c357587dfc47b8f7fb12d8fc4e9cf6639b69697e8c62ea8bd3aa00",
 "media": [],
 "changelog": [
  {
   "version": 1,
   "at": "2020-06-13T15:45:00Z",
   "note": null
  }
 ],
 "transclusions": []
}