Quarto Comments, Powered by the Fediverse

I built a Quarto extension!

I built an extension, and now my blog has fancy comments (and yours can too!)

personal
technology
open-source
Published

April 23, 2024

I’ve become a big fan of the “fediverse” in the last few years - social media let me find my own delightful community of crime/ai/evidence nerds, and I don’t want those systems to be any more centralised and out of my control than they are already. I also really like the scientific publishing platform Quarto (that’s what the site is built on!).

So last night, I got wondering how hard it would be to get Mastodon powered comments on this blog. Quarto does support a few native comment options, but predictably, nothing Fediverse compatible… so that’s why I built one! It’s bundled up as a neat little Quarto extension, and the whole thing was actually surprisingly painless.

Most of that is thanks to this excellent web-component, which does 90% of the technical heavy lifting - you can read about their implementation in more detail here. To cut a long story short, thanks to the open nature of the Fediverse, it’s relatively straightforward for some javascript code to get updates on a toot. Thanks to the surprisingly understandable Quarto extensions framework, all you then need is some Lua code to inject the component, along with your chosen variables into your Quarto theme, and after a bit of javascript tweaking and some help from ChatGPT, bob’s your uncle… in theory, you should be seeing comments below this post.

If you found this useful, leave a comment! I’d also very much welcome any PRs or contributions on my horrendous code (please help me fix it).