<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Comments feed</title>
        <link>https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/</link>
        <description>Leveraging IndieWeb to Avoid Storing Others&#39; Data on DIMV - Comments feed</description>
        <generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>evgeny@kuznetsov.md (Evgeny Kuznetsov)</managingEditor>
            <webMaster>evgeny@kuznetsov.md (Evgeny Kuznetsov)</webMaster><lastBuildDate>Sat, 19 Sep 2020 23:12:37 &#43;0300</lastBuildDate>
            <atom:link href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/comments.xml" rel="self" type="application/rss+xml" />
        <atom:link href="https://switchboard.p3k.io/" rel="hub" />
    <atom:link href="https://evgenykuznetsov.superfeedr.com/" rel="hub" />
    <item>
    <title>Evgeny Kuznetsov replied</title>
    <link>https://evgenykuznetsov.org/en/reactions/2021/indieweb-when/</link>
    <pubDate>Tue, 27 Jul 2021 20:55:38 &#43;0000</pubDate>
    <author>Evgeny Kuznetsov</author>
    <guid>https://evgenykuznetsov.org/en/reactions/2021/indieweb-when/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_1231570</guid>
    <description><![CDATA[<p>I first heard of IndieWeb in late 2014 or early 2015 on one of Leo Laporte’s podcasts: <span class="h-card"><a href="https://werd.io/" class="u-url"><i></i> <span class="p-name">Ben Werdmüller</span></a></span> and <span class="h-card"><a href="http://erinjorichey.com/" class="u-url"><i></i> <span class="p-name">Erin Jo Richey</span></a></span> were the guests and presented the then-newly-launched <a href="https://withknown.com/">Known</a> platform. <span class="h-card"><a href="http://www.kevinmarks.com/" class="u-url"><i></i> <span class="p-name">Kevin Marks</span></a></span> was also there, and I believe it was his pitch that had me sold on the whole concept. By the end of April 2015 I had a Known site, then started self-hosting when the hosted version got abandoned, and then it all continued downhill to the point where I now have migrated to a static site, prototyped <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">IndieWeb-glue</a>, and am planning to write my own webmention endpoint. I’ve been blogging on and off since 2003, and almost all of it is on my site now (I lost about a year worth of posts during all the migrations).</p>
<p>During the 2020 lockdowns I discovered the Russian-speaking Indieweb community and we did an online HWC meeting that was my first (and only, so far) “in-person” IndieWeb community experience. At the moment, I’m having a very extensive “<a href="https://indieweb.org/life_happens">life happens</a>” period but I’m very much looking forward to more community interaction once I have more time on my hands.</p>]]></description>
</item><item>
    <title>🔗: marty mcguire on the state of webmentions</title>
    <link>https://maya.land/responses/2020/10/22/marty-mcguire-on-the-state-of-webmentions.html</link>
    <pubDate>Thu, 22 Oct 2020 18:39:12 &#43;0000</pubDate>
    <author>Maya</author>
    <guid>https://maya.land/responses/2020/10/22/marty-mcguire-on-the-state-of-webmentions.html_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_884459</guid>
    <description><![CDATA[<p>Sometimes I think that the way people talk about webmentions (even <a href="https://webmentions.neocities.org">me</a>) is far too limited. The protocol itself is <em>incredibly</em> flexible. Why should it be that we limit ourselves to reinventing</p>
<ol><li>Comments sections, or</li>
<li>Twitter?</li>
</ol><p>Especially when those two things can be more elegantly done (even in a distributed manner) with <em>less</em> flexible solutions.</p>
<p><strong>What are other fun/weird things you could do with webmentions?</strong></p>
<p>His point on Javascript I'm not entirely in agreement with. For one, <a href="https://github.com/aaronpk/webmention.io">webmention.io is fully self-hostable</a> so having a static site with webmention content provided at runtime isn't at all bound to someone's ability to provide a service for free (I use <a href="https://github.com/zerok/webmentiond">webmentiond</a> for this). For another, this sounds like something a caching layer was designed to solve if anyone's site hits Scale. Add to this that runtime fetching of other people's PII is arguably superior, as <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">this</a> gets into a little. And finally, I don't think that displayed webmentions are something that necessarily <em>should</em> be machine-parsed. My content is marked up with <a href="http://microformats.org/wiki/microformats2">mf2</a> because I want to make it easy for people to parse and consume my content. I don't own the content I'm displaying as replies; even if there's an etiquette about excerpting for comments-section-type-usage, why should I be exposing it for even-more-indirect consumption?</p>]]></description>
</item><item>
    <title>Jamie Tanna bookmarked</title>
    <link>https://www.jvt.me/mf2/2020/09/ccldj/</link>
    <pubDate>Wed, 23 Sep 2020 07:24:08 &#43;0000</pubDate>
    <author>Jamie Tanna</author>
    <guid>https://www.jvt.me/mf2/2020/09/ccldj/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_854951</guid>
    <description><![CDATA[Jamie Tanna bookmarked <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/</a>]]></description>
</item><item>
    <title>Jan replied</title>
    <link>https://ochtendgrijs.be/notes/0275bbf48f/</link>
    <pubDate>Tue, 22 Sep 2020 09:15:00 &#43;0000</pubDate>
    <author>Jan</author>
    <guid>https://ochtendgrijs.be/notes/0275bbf48f/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_854563</guid>
    <description><![CDATA[<p><i>Als antwoord op <a class="u-in-reply-to" href="https://ochtendgrijs.be/blog/veiligheid-en-privacy-op-het-indieweb/">https://ochtendgrijs.be/blog/veiligheid-en-privacy-op-het-indieweb/</a>.</i></p>
<p>Nog enkele bedenkingen …</p>
<p>De meeste site-eigenaren willen natuurlijk dat er naar hun pagina’s wordt gelinkt. Denk aan SEO en zo. (Nu, iedereen wil op sociale media viraal gaan, ook. Tot een domme tweet je carrière dreigt te nekken. Dan wil je <em>terecht</em> ‘vergeten worden’.)</p>
<p>En het insluiten van ‘Open Graph’-inhoud is ook geen issue. Dat díént daarvoor. Als Facebook, en die cachen ook alles, dat mag, dan een ander ook. Waarom zou dat voor h-card-gegevens anders (moeten) zijn? (Omdat dat altíjd persoonlijke gegevens zijn?)</p>
<p>Voor de volledigheid: het <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">originele artikel</a> ging in de eerste plaats over het insluiten van veranderlijke inhoud, meen ik, en pas daarna over eventuele juridische aspecten.</p>]]></description>
</item><item>
    <title>Leveraging IndieWeb to Avoid Storing Others&#39; Data</title>
    <link>https://chrisburnell.com/like/1600732855/</link>
    <pubDate>Tue, 22 Sep 2020 00:08:03 &#43;0000</pubDate>
    <author>Chris Burnell</author>
    <guid>https://chrisburnell.com/like/1600732855_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_854383</guid>
    <description><![CDATA[Chris Burnell liked <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/</a>]]></description>
</item><item>
    <title>favourited https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/</title>
    <link>https://vincentp.me</link>
    <pubDate>Mon, 21 Sep 2020 22:39:58 &#43;0000</pubDate>
    <author>Vincent Pickering</author>
    <guid>https://vincentp.me/favourites/2020/09/22/10-38/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_854367</guid>
    <description><![CDATA[https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/]]></description>
</item><item>
    <title>Zachary Dunn replied</title>
    <link>http://adhoc.systems/replies/reply-indieweb-glue</link>
    <pubDate>Mon, 21 Sep 2020 13:28:05 &#43;0000</pubDate>
    <author>Zachary Dunn</author>
    <guid>http://adhoc.systems/replies/reply-indieweb-glue_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_854205</guid>
    <description><![CDATA[Nice! I think I might try using this on my site.]]></description>
</item><item>
    <title>❤️ : Leveraging IndieWeb to Avoid Storing Others’ Data</title>
    <link>https://pauho.net/2020/09/21/%e2%9d%a4%ef%b8%8f-leveraging-indieweb-to-avoid-storing-others-data/</link>
    <pubDate>Mon, 21 Sep 2020 12:46:32 &#43;0000</pubDate>
    <author>Paul Houlihan</author>
    <guid>https://pauho.net/2020/09/21/%e2%9d%a4%ef%b8%8f-leveraging-indieweb-to-avoid-storing-others-data/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_854175</guid>
    <description><![CDATA[<span style="max-height:1rem;margin-right:.5rem;" title="Like"></span><a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/" class="p-name u-url">Leveraging IndieWeb to Avoid Storing Others’ Data</a> by <a href="https://evgenykuznetsov.org" class="h-card p-author"><img class="u-photo" src="https://evgenykuznetsov.org/img/avatar.jpg" alt="Evgeny Kuznetsov" width="32" height="32" />Evgeny Kuznetsov</a><blockquote class="e-summary"><p>Owning your own data is great. I’ve been using this website as the central IndieWeb point of my online life for over five years, and I love it. However, the joy of owning your own website comes bundled with great responsibility: as the website owner, I am responsible for what’s on my site and fo…</p></blockquote>


<span>Also posted to:</span><ul><li><a class="u-syndication" href="https://mastodon.social/@pauho/104902975922685632"> <span style="max-width:1rem;margin:2px;" title="Mastodon">Mastodon icon</span></a></li></ul>]]></description>
</item><item>
    <title>Frank Meeuwsen mentioned</title>
    <link>https://diggingthedigital.com/leveraging-indieweb-to-avoid-storing-others-data/</link>
    <pubDate>Mon, 21 Sep 2020 11:20:07 &#43;0000</pubDate>
    <author>Frank Meeuwsen</author>
    <guid>https://diggingthedigital.com/leveraging-indieweb-to-avoid-storing-others-data/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_854172</guid>
    <description><![CDATA[<a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/" class="p-name u-url">Leveraging IndieWeb to Avoid Storing Others’ Data</a> by <a href="https://evgenykuznetsov.org" class="h-card p-author">Evgeny Kuznetsov</a>
<blockquote class="e-summary"><p>Owning your own data is great. I’ve been using this website as the central IndieWeb point of my online life for over five years, and I love it. However, the joy of owning your own website comes bundled with great responsibility: as the website owner, I am responsible for what’s on my site and fo…</p></blockquote><p>Dit vind ik <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">een interessant experiment</a>. Hoe kun je een link naar een andere site rijker maken, zonder extra plugins, zelf data opslaan, maar door gebruik te maken van de protocollen die op die andere site staan. Het is nog verre van een perfecte technische oplossing en het is geen plugin die je even aanzet. Maar het begin is weer gemaakt om verder te bouwen op <a href="https://diggingthedigital.com/indieweb-lees-en-schrijf-bouwstenen/">de indieweb-bouwstenen</a>. En dat is altijd goed nieuws.</p>
<p><a href="https://diggingthedigital.com/leveraging-indieweb-to-avoid-storing-others-data/">https://diggingthedigital.com/leveraging-indieweb-to-avoid-storing-others-data/</a></p>]]></description>
</item><item>
    <title>Jeannie liked</title>
    <link>https://twitter.com/nekr0z/status/1307413047271739395#favorited-by-1295515323567878144</link>
    <pubDate>Sat, 19 Sep 2020 21:38:15 &#43;0000</pubDate>
    <author>Jeannie</author>
    <guid>https://brid-gy.appspot.com/like/twitter/nekr0z/1307413047271739395/1295515323567878144_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_853784</guid>
    <description><![CDATA[Jeannie liked <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/</a>]]></description>
</item><item>
    <title>Webmentions Again (And More)</title>
    <link>https://evgenykuznetsov.org/en/posts/2021/old-comments/</link>
    <pubDate>Tue, 31 Aug 2021 12:22:04 &#43;0000</pubDate>
    <author>Evgeny Kuznetsov</author>
    <guid>https://evgenykuznetsov.org/en/posts/2021/old-comments/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_1259517</guid>
    <description><![CDATA[<p>Up until recently, I had webmentions displayed using <a href="https://github.com/PlaidWeb/webmention.js">webmention.js</a>, and I highly recommend it as the simplest way to those of you who still don’t. This solution was, however, always meant to be temporary, if only to avoid being locked into <a href="https://webmention.io/">webmention.io</a>. As a first step of getting out of the lock-in, I re-did the whole webmentions display thing this summer. It all looks mostly the same (which was one of the points), but “under the hood”…</p>
<p>A question that immediately arises when you start thinking about writing your own webmention endpoint: “How do I store?” You start having thoughts of databases, good and bad things about them, but with that way of thinking it’s much easier if you just self-host webmention.io (it’s open-source) and avoid all the hassle. My website is built with <a href="https://gohugo.io/">Hugo</a>, and I really like the fact that everything is stored as simple text files in one git repository. It’s only logical to store webmentions the same way, isn’t it?</p>
<p>What pushed me was <a href="https://rowanmanning.com/posts/webmentions-for-your-static-site/">the article about doing webmentions on a Hugo-based website</a>: why not make the server check webmention.io from time to time and save the new webmentions to a JSON, I could surely build on that. The idea of storing them in a separate file in <code>/data/</code> was immediately discarded: <a href="https://gohugo.io/content-management/page-bundles/">Page Bundles</a> were invented so that we could store each post (<code>index.md</code>) together with the webmentions (<code>webmentions.json</code>) in the same subdirectory. The webmentions that target the site as a whole (such as <a href="https://indieweb.org/person_mention">person mentions</a>) I can store in a <code>webmentions.json</code> right in <code>/content/</code> (and not yet display)…</p>
<p>The author of the aforementioned article does the saving in JS and runs it on Netlify. I don’t do Netlify, so I need a separate tool for saving, which fortunately has <a href="https://evgenykuznetsov.org/en/posts/2020/webmention-backup/">already been developed</a>. All I needed was to add an option to save to separate subdirectories, which I <a href="https://github.com/nekr0z/webmention.io-backup">did</a>. I also added more options while I was at it (not sure if anyone needs those).<a href="https://evgenykuznetsov.org/en/posts/2021/old-comments/#fn:1">1</a> Also, the code that does the saving to subdirectories will likely be reused later when I write a webmention endpoint.</p>
<p>Here comes the first “oops”: many of the site’s pages (including almost all the Reactions) are text-only, so I was too lazy to make Bundles for them. In Hugo, the contents of a page addressed as <code>https://evgenykuznetsov.org/posts/2021/old-comments/</code> can reside either in <code>/content/posts/2021/old-comments.md</code>, or in <code>/content/posts/2021/old-comments/index.md</code>; in the latter case the same subdirectory can be used to store the images and whatever is needed on the page, and this is exactly what’s called a “Page Bundle”. Since I was going to store webmentions in Bundles, the first way of storing the pages doesn’t really work, and I have already accumulated enough pages stored in this manner. I needed to re-save all of them in another way, each in its own subdirectory, and doing it manually would take all summer, especially considering different language variants. Bash to the rescue:</p>



<pre><code><span> 1
</span><span> 2
</span><span> 3
</span><span> 4
</span><span> 5
</span><span> 6
</span><span> 7
</span><span> 8
</span><span> 9
</span><span>10
</span><span>11
</span><span>12
</span><span>13
</span><span>14
</span><span>15
</span><span>16
</span><span>17
</span><span>18
</span><span>19
</span><span>20
</span><span>21
</span><span>22
</span></code></pre>


<pre><code><span>#!/bin/bash
</span><span></span><span>set</span> -e

<span>wd</span><span>=</span><span>$(</span><span>pwd</span><span>)</span>

<span>if</span> <span>[[</span> <span>"</span><span>$1</span><span>"</span> !<span>=</span> <span>""</span> <span>]]</span><span>;</span> <span>then</span>
        <span>wd</span><span>=</span><span>"</span><span>$1</span><span>"</span>
<span>fi</span>

<span>for</span> x in <span>"</span><span>$wd</span><span>"</span>/*.md<span>;</span> <span>do</span>
        <span>case</span> <span>"</span><span>$x</span><span>"</span> in 
                *.ru.md<span>)</span>    <span>suffix</span><span>=</span><span>"ru.md"</span><span>;;</span>
                *.en.md<span>)</span>    <span>suffix</span><span>=</span><span>"en.md"</span><span>;;</span>
                *.md<span>)</span>       <span>suffix</span><span>=</span><span>"md"</span><span>;;</span>
                *<span>)</span>          <span>continue</span><span>;;</span>
        <span>esac</span>
        <span>name</span><span>=</span><span>"</span><span>${</span><span>x</span><span>%%.*</span><span>}</span><span>"</span>
        <span>if</span> <span>[</span> ! -d <span>"</span><span>$name</span><span>"</span> <span>]</span><span>;</span> <span>then</span>
                mkdir <span>"</span><span>$name</span><span>"</span>
        <span>fi</span>
        mv <span>"</span><span>$x</span><span>"</span> <span>"</span><span>$name</span><span>/index.</span><span>$suffix</span><span>"</span>
<span>done</span>
</code></pre>


<p>…and long live Stack Overflow!</p>
<p>From there it was easier. I removed webmention.js from the templates, wrote the processing of the bundled JSON (which in many ways was the same webmention.js translated from JavaScript into Hugo templating language and customized to my needs), fixed CSS (I now know much more about CSS/SaSS than I did in June), and wrote a template for comments RSS-feeds. I also marked avatars and names for <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">dynamic loading</a> and uncovered a couple of bugs in <code>indieweb-glue</code> along the way: some things were not cached when they should have, especially the 404s that also lacked CORS headers, I fixed all that. Everything works! Admittedly, webmentions no longer appear immediately (only after the next rebuild of the site), but now I can pre-moderate them if I ever feel like it.</p>
<p>Yay, now I could also display older webmentions, the ones I received back when I was running Known; I did save them when I moved from Known to Hugo, and I used the same JSON structure as webmention.io! I only wonder what happened to all the avatars… Oh, it turns out that Known stored the avatars for the received webmentions, and all the links are to <code>evgenykuznetsov.org/service/web/imageproxy/</code> that no longer exists. Those links need to be removed. Not by hand, of course, we have <code>jq</code> and the magic of <code>find</code>, thank Discordia for Stack Overflow!</p>
<pre><code>find ./ -type f -name "webmentions.json" \
    -printf \
        "jq -c 'del \
            (..|.photo?| \
            select(contains \
            (\"evgenykuznetsov.org/service/web/imageproxy\")?) \
            )' %p | \
        sponge %p\n" \
    | \
sh
</code></pre>
<p>Hmm, what was the format I saved the comments from Google+, LiveJournal and diary.ru in? The same webmention.io-inspired JSON, how cute! Let’s display those, too… Oops! Likes in G+ had no date so the RSS template breaks: Hugo happily parses a date from <code>nil</code> and gets a value of <code>error.Error</code> type that can’t be further processed. Another check there, and here we go: right here on my website, the comments that are over 15 years old! So fascinating to read, especially the comments from back when the blog was much more personal… Some nicknames I can no longer remember, some have departed from this world, some I still talk to regularly, and some provoked an urge to immediately contact. A blog that is almost a half of the life old, and with comments, beats any personal journal.</p>
<p>Writing my own webmention endpoint is next on the roadmap.</p>
<ol><li>
<p>By the way, if you do the same and save webmentions as JSON, I strongly advise pretty-printing the file (the same way <code>jq</code> does by default). This takes hundreds of extra bytes per page but makes a tremendous difference in <code>git diff</code>. <a href="https://evgenykuznetsov.org/en/posts/2021/old-comments/#fnref:1">↩︎</a></p>
</li>
</ol>]]></description>
</item><item>
    <title>New Home for indieweb-glue</title>
    <link>https://evgenykuznetsov.org/en/posts/2022/heroku/</link>
    <pubDate>Sat, 10 Sep 2022 20:00:05 &#43;0000</pubDate>
    <author>Evgeny Kuznetsov</author>
    <guid>https://evgenykuznetsov.org/en/posts/2022/heroku/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_1516072</guid>
    <description><![CDATA[<p>A couple of weeks ago, Heroku <a href="https://blog.heroku.com/next-chapter">announced</a> they will be shutting down all their free plans this November. I’ve been using Heroku to host <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">indieweb-glue</a> for the last two years, and — in principle — I would be ready to pay for the nice service they provide, although the prices they’re announcing are somewhat discouraging for a little project like mine.</p>
<p>However, paying for Heroku isn’t even an option: I am Russian, I live in Russia, so paying online for non-domestic services requires jumping through too many hoops these days.</p>
<p>Of course, <a href="https://evgenykuznetsov.org/en/go/indieweb-glue/">indieweb-glue</a> will live on. I’ll be hosting it on the same VPS I host this website on, at least for the time being. However, the <code>indieweb-glue.heroku.com</code> URL will have to go, so if you are using indieweb-glue<a href="https://evgenykuznetsov.org/en/posts/2022/heroku/#fn:1">1</a> (and don’t host your own copy), be sure to update the URL to <code>indieweb-glue.evgenykuznetsov.org</code> before the end of November.</p>
<p>I should have used my own domain for the URL from the start, but learning how to set it all up seemed too much of a hassle back then<a href="https://evgenykuznetsov.org/en/posts/2022/heroku/#fn:2">2</a>. Well, here’s a lesson: own your data and own your URLs, IndieWeb is good for you!</p>

<ol><li>
<p>I know at least <span class="h-card"><a href="https://adhoc.systems/" class="u-url"><i></i> <span class="p-name">Zack</span></a></span> does, or did at some point. <a href="https://evgenykuznetsov.org/en/posts/2022/heroku/#fnref:1">↩︎</a></p>
</li>
<li>
<p>It turned out to be extremely simple. <a href="https://evgenykuznetsov.org/en/posts/2022/heroku/#fnref:2">↩︎</a></p>
</li>
</ol>]]></description>
</item><item>
    <title>Hovercards and Cover Images</title>
    <link>https://evgenykuznetsov.org/en/posts/2022/hovercards/</link>
    <pubDate>Thu, 01 Dec 2022 14:13:01 &#43;0000</pubDate>
    <author>Evgeny Kuznetsov</author>
    <guid>https://evgenykuznetsov.org/en/posts/2022/hovercards/_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_1572466</guid>
    <description><![CDATA[<p>I’ve been toying with the idea of adding hovercards to this site for quite some time now. Some things were holding me back, my lack of technical competence not the last among them, but I finally did it.</p>
<p>The final push was reading about the <a href="https://maggieappleton.com/xanadu-patterns#1-visible-links">visible links</a> idea which makes a lot of sense to me. As that article points out, Wikipedia does hovercards for a reason, and while I don’t claim my writing is similarly important, the general idea of giving a reader more context with less effort is rather appealing.</p>
<p>One thing that has been holding me from attempting to implement this feature earlier is mobile. Hovercards don’t make sense with touch-screen interfaces and I was reluctant to add to my website something that would be unusable on mobile. Not that I’m a huge mobile fan, but I try to make sure my site is available and accessible on mobile, too. On the other hand, <a href="https://evgenykuznetsov.org/git/">the gitweb interface</a> is hardly accessible on mobile, either, but nor does it make real sense to access it on mobile, so I have it on my site. Wikipedia doesn’t do hovercards on mobile either; what works for them is good enough for me, I suppose.</p>
<p>With these thoughts, I went on to get my hands dirty with the technical side of things. It was very nice of <span class="h-card"><a href="https://jamesg.blog" class="u-url"><i></i> <span class="p-name">capjamesg</span></a></span> to have <a href="https://jamesg.blog/2022/10/12/hovercards/">recently sorted out</a> all the hard stuff (I know, I know, I need to teach myself JavaScript for real), so I didn’t have to start from scratch. Of course, I don’t use the backend James uses, so that’s what I needed to sort out on my own.</p>
<p>Where should the information for a hovercard come from? The most straightforward approach is to use the information that the linked page provides about itself. For the reasons I laid out <a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">earlier</a>, I didn’t want to pre-fetch and store that information the way James does, so the obvious solution was to leverage <a href="https://indieweb-glue.evgenykuznetsov.org">indieweb-glue</a>. Of course, it had to be taught to return the information about pages in addition to people. One form for a page to provide such information about itself is the <a href="https://ogp.me/">Open Graph protocol</a>, it is rather widely used, so that’s what I decided to start with.</p>
<p>After some mild code refactoring, I added Open Graph meta tags processing to <code>indieweb-glue</code> and <a href="https://evgenykuznetsov.org/git/?p=hovercard.js.git">modified</a> James’s script to fetch the information from there. I also made it look for a specified class instead of an <code>&lt;article&gt;</code> tag since it gives me more control over which pages and parts of the pages hovercards appear on. With some CSS thrown into the mix, it’s all working quite to my satisfaction now. Surprisingly so, I must say.</p>
<p>As an added benefit, the same script can be used to produce hovercards for footnotes<a href="https://evgenykuznetsov.org/en/posts/2022/hovercards/#fn:1">1</a> on the fly, and that’s something I’m even more fond of. Footnotes have been my pet peeve for a long time. They are a really nice instrument to have when writing a text, allowing one to avoid interrupting the flow of thought with distractions and digressions. However, in digital media, footnotes are often hidden beyond the screen edge, and scrolling or following a link to look at them is usually too much distraction. On paper, all you need to do is look down, and we are good enough at returning our sight focus back to where it was on the page so that taking a look at a footnote doesn’t interrupt our reading process too much. Having footnotes in hovercards feels like a reasonable compromise.</p>
<p>The result is not yet perfect, and all this is still a work in progress. CSS needs more figuring out: my hovercards don’t always look good, especially when the image is in portrait orientation. Also, <code>indieweb-glue</code> could (and should) use things beyond the Open Graph protocol to extract useful info from web pages. A good example is Wikipedia: its pages lack <code>og:description</code>, but the first paragraph of the text itself looks like a perfect thing to have in a hovercard linking to a Wikipedia page. I also plan to modify the script so that it recognizes some special cases, such as <a href="https://indieweb.org/person_mention">person mentions</a>, where populating the hovercard with H-Card data is appropriate, for example.</p>
<p>Of course, I’d highly appreciate any comments, advice or thoughts on how to make these things better. For a work in progress, these are always welcome.</p>
<p>As I was writing this post, I noticed that the first link (the one to <span class="h-card"><a href="https://maggieappleton.com" class="u-url"><i></i> <span class="p-name">Maggie Appleton</span></a></span>’s article) produces a hovercard with a nice cover image that is obviously autogenerated. Of course, I immediately wanted something like this for my posts that lack a cover image.</p>
<p>Technically, the Open Graph protocol lists <code>og:image</code> as one of the <em>required</em> properties, meaning that every page should have one. Of course, finding a good (or even acceptable) cover image for every post can be too much hassle. There are three possible ways to deal with it: have a generic site-wide image for all the pages lacking their own images, have the images autogenerated, or have no image at all for some pages. The latter option violates the protocol, obviously, but it is used widely enough, and I also resorted to it until now.</p>
<p>I asked around (in the <a href="https://matrix.to/#/!vRODLVURUpxrbkRiYp:matrix.org">Russian IndieWeb chatroom</a>, naturally). The way most people (including Maggie) seem to go about it is by using <a href="https://playwright.dev/">Playwright</a>, a headless browser developed for testing, to open the page and make a “screenshot”. This is a fascinating hack, but it doesn’t quite suit my workflow. I’ve also found <a href="https://github.com/Ladicle/tcardgen">a piece of software</a> tailored specifically for Hugo, as well as some more general guidelines on how to generate cover images programmatically with JavaScript or Python. Those guidelines got me really thinking, and I ended up writing a Hugo template that generates a picture automatically for every page that doesn’t have a featured image.</p>
<p>It works, although it, too, is very much a work in progress. Image processing in Hugo is somewhat limited, and also I’m not a very visual person, so these things are always hard for me. It’s currently a very simple script that only uses the site’s favicon, the author information and the page title, and it does nothing to adapt to the title’s length (so the text would sometimes overflow or look out of place). The good thing is, most of it can be fixed with time, and the script expanded to take into account more information about the page. Still, even as it is, it’s better than nothing, I think. At least every page does have <code>og:image</code> property now.</p>

<ol><li>
<p>I know I tend to abuse this feature sometimes. <a href="https://evgenykuznetsov.org/en/posts/2022/hovercards/#fnref:1">↩︎</a></p>
</li>
</ol>]]></description>
</item><item>
    <title>Troels Thomsen liked</title>
    <link>https://ap.brid.gy/convert/web/https://mastodon.social/users/tt%23likes/196889002</link>
    <pubDate>Sat, 07 Dec 2024 12:38:13 &#43;0000</pubDate>
    <author>Troels Thomsen</author>
    <guid>https://ap.brid.gy/convert/web/https://mastodon.social/users/tt%23likes/196889002_https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/_1865846</guid>
    <description><![CDATA[<a href="https://evgenykuznetsov.org/en/posts/2020/indieweb-glue/">likes this.</a>]]></description>
</item></channel>
</rss>