Blog comments via Mastodon

I’ve replaced my Disqus comment integration with a Mastodon-powered solution. On posts where I’ve enabled comments, you’ll now see a “Load Comments” button and a “Reply” button, both of which talk to the Mastodon API.

Adding commenting to a static site is an interesting puzzle.

comment code It’s really an integration question. What server-side comment solution best provides what you need, and what’s the lowest-friction integration into your static site generator of choice?

Third-party service like Commento or Disqus? Deploy your own on a VPS? Integration with Twitter, Mastodon, Diaspora?

To make sense of the options I recommend reading Darek Kay’s great, thorough writeup. (Including one involving a GitHub issue for each blog post, embedding the issue’s comment thread as your post’s comment section!)

Leveraging Mastodon was the most appealing path for me, and Carl Schwan’s solution for Hugo does what I need without any excess complexity. (There’s nothing Hugo-specific about the technique, by the way, in case you use Pelican or whatever.)

With this solution in place, to enable commenting on a post, I post (um I mean “toot”) a link to it on Mastodon, then add the ID of that toot to the post’s metadata. Despite the bit of extra effort there (and the race condition), I like it. I’m especially glad to have the comments be part of a larger social space. It reminds me a bit of the energy around blog trackbacks and pingbacks back in the day.

Here’s Carl’s post with the implementation (via the Wayback Machine; carlschwan.eu is down today).


Comments


Share: