Webmentions are an often forgotten #W3C recommendation (since 2017) that should probably be leveraged more often in the world of federated/decentralized Web services.
Comments, reactions and other forms of engagement, rather than content itself, are what keep people often confined to traditional centralized fenced gardens.
Sure, I may write to my own self-hosted blog, with minimal JS, rendering plain Markdown content shared from my Obsidian vault, Gitlab repo or whatever, and I may serve my nice RSS/Atom feed so my readers are kept in the loop.
But how do people engage with that content?
We got a few options:
Reinventing the wheel of comments management on my platform? Requiring users to register in order to post a comment? Managing state consistently on the db and handling issues like spam and moderation? Or inject 3rd-party frameworks like Disqus in my code, or 3rd-party login buttons? Ugh…
Posting to natively federated platforms, like WriteFreely or Wordpress with the ActivityPub plugin? Sure, but that comes with its own issues:
- It creates a kind of “presentation duality” issue. Your content is visible on your website (without any comments or forms of engagement), and it’s also visible from a Mastodon-compatible client (and comments and reactions will only be visible there).
- Only ActivityPub-compatible clients will be able to interact with it. If you want other forms of interactions, you’ll probably need other plugins.
- ActivityPub isn’t exactly an easy protocol to implement from scratch. Adding ActivityPub to my blogging platform just because I need engagement sounds like overkill.
Post a link to your article on social media platforms. Facebook, X, LinkedIn, Threads, Bluesky, Mastodon, Reddit, HackerNews, Lobsters…you name it. Copy-paste that link everywhere like it’s 1999, the comments section of your post on each of those platform will become “your” comments section (which may suddenly disappear if moderators decide to remove your link), users from different platforms can’t see nor interact with each others’ comments, and you overall get the worst of the two worlds (centralized platforms that still require content to be manually submitted to each of them, without any chance of mutual interaction, and without you being the owner of your own comments section, which defeats the POSSE principle many times over)
Webmentions come to the rescue.
And there are only a couple of requirements to implement them properly:
Receiver side
Your site needs to implement an e.g. POST /webmention endpoint. Those who want to comment, mention or react to your content will call that endpoint with a payload that includes at least source (the URL that mentions your page) and target (the target on your site that got mentioned)
You need to publish a <link rel="webmention"> in your page and/or a Link: <https://...>; rel="webmention" response header, so that any client knows that you support Webmentions, and which URL it should call.
When a request is received on your endpoint you can do whatever you want with it. Store it on a database and render it on your own page, forward it to some other platform, just display some “engagement counters”…the sky is the limit, and with microformats things can be extremely versatile - reactions can contain text, emoji reactions, any kind of media, events, locations, reviews, resumes, recipes etc.
Sender side
When you send some content that references other URLs your platform should:
That’s it.
I am currently working on implementing Webmentions support on madblog.
If things work fine I’d also love to submit a PR to WriteFreely.
And if anyone knows if something like this has already been proposed on Mastodon please let me know. It’d be amazing to have native Webmentions support whenever my Mastodon post includes a link, so the site on the other side can directly render Mastodon comments and reactions in their comments sections too.