




















Imagine my surprise, when, roughly two weeks ago, I received a direct message on Mastodon from Brandon Kelly, the founder and head of the team behind Craft CMS, opening with:
👋 I spent today working on a Craft 5 port of your Webmention plugin.
My Webmention plugin? The one I always meant to rewrite? The one that was still stuck on Craft 2? The very reason why my personal site was missing all Webmentions after I had upgraded to Craft 5 towards the end of 2024? Yes, that Webmention plugin. So, naturally, I was thrilled!
What followed were several days messaging back and forth with Brandon on Discord, fixing bugs, testing Webmention sending and receiving, tweaking and optimizing features, while Brandon basically rewrote all the parts necessary to bring the plugin over to Craft 5 – and added other substantial improvements. And so, after about two weeks, an updated version of the plugin is now available for free on the Craft Plugin Store:
The most significant – and breaking – change is Craft 5 compatibility, obviously. And, of course, the plugin retains its core functionality of sending and receiving Webmentions on your personal site: it will send out Webmentions for all links included in your posts and add a Webmention endpoint to receive mentions from others. But there are many more improvements under the hood that make this version 1.0.0 already much more robust and convenient than the previous version.
Webmentions now not only store the target URL but are actually tied to the Craft element they belong to. This makes it much easier to retrieve Webmentions for individual entries, like blog posts, but allows for changing an entry‘s URL without breaking the connection to its Webmentions. And it also opens up new possibilities for future plugin improvements.
In the control panel, it is now possible to manually trigger an update of individual Webmentions. Also, the list view of all Webmentions now contains direct links to related posts.
Another huge improvement is that avatars are now Craft assets. So instead of just dumping them into a folder, avatars are now stored as proper assets that can be image-transformed and are eager-loadable – which means substantial performance improvements for posts with a larger amount of Webmentions. Ahem.
We also added new behaviors that allow for convenient fetching of all Webmentions for an element:
{% for webmention in entry.getWebmentions() %}
…
{% endfor %}
And if you want to fetch only Webmentions of a certain type, like comments, likes, or reposts, you can call getWebmentionsByType() on the element.
What also needed fixing was a tricky regular expression used to identify links in entries, especially when those URLs are wrapped in the parentheses of a Markdown link. And we updated how the plugin handles Webmentions coming from social media platforms via Bridgy: Webmentions from Mastodon, Bluesky, GitHub, and Reddit are now stored with the correct site type.
And, and we’ve given the plugin a fresh new icon, inspired by Paul Robert Lloyd’s IndieWeb building block icon designs.
Overall, I’m incredibly happy with the result and I can’t thank Brandon enough for bringing this little project back to live. Not only does it feel good to finally see Webmentions again on this site. It is also a fantastic opportunity to develop the plugin further and explore how Webmentions can work even better on personal sites.
There are still a lot of things that would be interesting to try out next. How replies and replies to replies could be displayed in a more chat-like view, for example. Or how to auto-populate your site with all Webmentions you’ve already received in the past via Mastodon, Bluesky, et al. Or, how the plugin could potentially handle GDPR-related issues around consent and storing and displaying personal information better – a concern a lot of people have raised in the past regarding Webmention. Which brings me a few important questions:
What would you like to see in future versions of this plugin? What is missing from Webmentions to make them a really great and valuable experience? And, in case you install and try out the plugin yourself, did or did not yet work for you? We’d love to hear all that.
So, in case your site is running on Craft 5, install the plugin and let us know where we can do better, for example by filing an issue. You will find all necessary information on how to install and configure the plugin in the documentation in the project’s GitHub repository.
We hope you like it. 🤗
~
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。