I love comment sections! For better or for worse, Iām someone who immediately scrolls down to the bottom of an article to see what people are saying about it. Often before reading the article itself š
Here, on my own site, Iāve also always wanted to display the feedback I get. People often point out mistakes, suggest improvements, or add context I hadnāt considered. I regularly update articles based on these conversations, trying to credit them by linking to their sites or posts. It sure would be nice to have all that feedback right below the article, wouldnāt it?

Comment systems
I didnāt want to outsource this to a third-party comment platform. Having to rely on any service in 2025 feels risky. How does enshittification work for comment platforms? I donāt even want to find out.
On the other hand I donāt want to run my own commenting platform either. Handling accounts, moderating discussions, dealing with spam, and all that. Nope!
I also looked into webmentions. Thereās even a great Kirby plugin that handles them. But in the end it was too much overhead for me. For my own site the priority is keeping things simple.
Then I stumbled over Michael Thomasās blog post about using Mastodon replies as comments. What a clever idea! I have a lot of trust and love for Mastodon. This means I donāt even mind forcing my readers to create an account there if they want to leave feedback on my articles. Itās a win-win! Mastodon, or rather my instance, also handles moderation and spam protection for me.
My first steps
I started with a simple frontend-only implementation based on Michaelās approach: a bit of JavaScript that fetched replies directly from Mastodonās API and rendered them on the page. Simple and lightweight, it worked surprisingly well.
But then I realised I was hitting Mastodonās API on every single page load. When kind people like Andy Bell or Stefan Judis share my articles, they can easily get thousands of visitors in a short time. Hammering the Mastodon API with that kind of traffic felt wrong.
Ideally, Iād cache the replies on my server and only refresh them once in a whileā¦
A Kirby plugin!
I moved everything to the backend and created a proper Kirby plugin that fetches replies server-side.
Kirbyās built-in page cache makes sure the API is only hit once per day. At least thatās how I set it up for now.
The plugin fetches replies from Mastodonās public API and also reconstructs the nested conversation threads. It registers a $page->mastodonReplies() page method thatās used in the built-in snippet to display the replies.
I just have to add a Mastodon post URL to my articleās content file:
Mastodon_url: https://mastodon.social/@medienbaecker/115496954893941334
If youāre using the Panel for your site, you can add a field to the blueprint like this:
fields:
mastodon_url:
label: Mastodon URL
type: url
Then, in your article template, you just include the snippet where you want the replies to appear:
<?php snippet('mastodon-replies') ?>
When a page has a valid Mastodon URL, the plugin fetches and displays all replies to that post.
Pretty cool, too: the HTML from Mastodonās API already includes helpful <span> elements with invisible and ellipsis classes to format long URLs.
I might add more customisation options in the future, but for now, it works well out of the box. Inspired by other peopleās Kirby plugins, you can override several snippets to customise the output.
For example here on my own site I added site/snippets/mastodon-replies/outro.php with a āJoin the conversationā button.
Replies
-
@medienbaecker Test
-
@markusr Thanks for the test, Markus. Hereās a nested reply š¤
-
@medienbaecker It works! š„³
-
@medienbaecker @getkirby This is a cool idea!
I have questions. How do handle not knowing the Mastodon post URL when posting the article on your site?Have you automated the Mastodon post, or is it: Post article on website, copy link of post, write Mastodon post and send it, copy link from Mastodon post, add it to the blog post?
-
@MoritzGlantz Yeah, that's exactly how I'm doing it right now. When the page doesn't have a Mastodon post URL, the "Replies" section simply doesn't show up. I might want exactly that for certain kind of articles and I like the simplicity. But there's definitely potential for automation š
-
@medienbaecker @getkirby itās beautiful! Great work, Thomas.