Adding support for Webmentions
I’ve added Webmention support to the posts on this blog.
Webmentions are a method for websites to know that they’ve been linked to (or mentioned) from elsewhere on the web.
Webmention is a web standard for mentions and conversations across the web, a powerful building block that is used for a growing federated network of comments, likes, reposts, and other rich interactions across the decentralized social web.
When you link to a website, you can send it a Webmention to notify it. If it supports Webmentions, then that website may display your post as a comment, like, or other response, and presto, you’re having a conversation from one site to another!
It depends on a couple of things being in place for it all to work, but I’ve implemented the basics to fetch and display any mentions that have been detected by the webmention.io service.
I have already been using Github Issues-powered commenting for the past couple of years, so I took the time to consolidate comments and Webmentions in to a single chunk of “interactions” functionality to fetch, cache, and render any comments or Webmentions. This is all done with native JS and could probably be improved further with a framework like Vue.js, but it works fine for now.
I’m using brid.gy to recieve Webmentions from Twitter and Reddit interactions via webmention.io — this will mean that if somebody shares/likes/retweets a link to one of my blog posts on either platform it will display that here below the post.
I’m using webmention.app and IFTTT to automatically try and send webmentions to sites I link to from within my posts.
As you can see it’s a bit complicated, and it feels like it’s held together with duct tape in places, but for now it works!
Lots of others have written about how they’ve implemented Webmentions on their sites, and these write-ups were really useful when arriving at my own implementation.
So to share the love, here are some links to those posts:
- Webmentions - Phil Gyford
- Webmentions for your Static Site - Rowan Manning
- Using Web Mentions in a static site (Hugo) - Paul Kinlan
- Adding Webmention Support to a Static Site - Keith J. Grant
- Adding Webmentions to My Static Hugo Site - Ana Ulin
- Using Webmentions in Eleventy - Max Böck
- Webmentions: Enabling Better Communication on the Internet - Chris Aldrich
- Add Webmention support to your website in ten minutes - Daniel Aleksandersen
- Sending your First Webmention from Scratch - Aaron Parecki
- Implementing Webmention on a static website - Deluvi
- Adding Webmention Support from Scratch - Dwayne Harris
- Social media responses on a Jekyll site using webmentions - James Dinsdale
- Adding webmentions to my blog - Sebastian De Deyne
- A Brief Look at WebMention - Ben Shi
- IndieWebify.Me
And that’s about it really. I’ll be tweeting a link to this post once it’s published and then any replies or likes will hopefully appear at the bottom of the page.
Discussion
Max Glenister mentioned on via twitter.com
Max Glenister commented on via github.com
If all of this Webmention malarky is overwhelming for you and you just want to drop a nice reply, feel free to do it on the Github issue
Tomás Mayr replied on via twitter.com
Hi mom, I’m on omgmog.
Max Glenister mentioned on via indieweb.social
📣 My blog supports #webmentions!
It's held together with duct tape, but it should all work... Interactions with this toot should appear on the post https://blog.omgmog.net/post/adding-support-for-webmentions/
iridescentFluid replied on via queer.party
@omgmog nice !
trainingmontage replied on via indieweb.social
@omgmog That’s so cool! Once I get some spare time to work on my site again I’m going to start doing stuff like this.
Max Glenister replied on via indieweb.social
@trainingmontage It’s a great yak to shave! There are a number of implementations to make the process easier, but it’s quite fun rolling your own too! ⌨️ 🔥
Minutes to Midnight replied on via indieweb.social
@omgmog I used to have the same feeling about duct tape, but then, after a few months, it’s been working fine on my website. #indieweb indieweb
Max Glenister replied on via indieweb.social
@m2m Yeah I imagine it’s fine, but I can’t help but worry that it depends on so many moving pieces, and two external services (webmention.io, and brid.gy), and it’s all fetched/processed on the client-side. I’ll get around to caching the webmentions myself somewhere at some point…
Philip Newborough replied on via indieweb.social
@omgmog very cool, I need to take a look at this.
Abid Nevesinjac replied on via mastodon.social
@omgmog Guess that plugin needs some improvements to avoid using duct tape 😜 Just kidding, this is very useful addon
Hyolobrika replied on via mstdn.io
@omgmog This post isn’t showing up on the blog for some reason. But it is showing up on https://indieweb.social. Strange.
Max Glenister replied on via indieweb.social
@Hyolobrika Ah the joys of posting that you’ve done something, then continuing to fiddle with it! By default webmention.io was returning just the latest 20 responses. Looks like I need to implement pagination properly. For now I’ve increase the responses limit. Cheers!
Mek101 replied on via mstdn.io
@Hyolobrika @omgmog How do I trigger it?
Max Glenister replied on via indieweb.social
@Hyolobrika Yes and no. Services such as brid.gy are essential to get webmentions from platforms that don’t fully implement microformats such as Twitter, Reddit, etc. Webmention.io is a pretty handy go-between to store webmentions as I’m currently serving a static Jekyll site. I’ve got plans to eventually spin up my own endpoint and cache on a server somewhere, but not enough hours in the day 😭
Hyolobrika replied on via mstdn.io
@Mek101 Idk. The author is trying to fix it.
Pete Moore replied on via fedi.pimoore.ca
@omgmog Love IndieWeb technology, nicely done!
Wouter Groeneveld replied on via brainbaking.com
Zomg Max, congrats! Next step: getting rid of third-party reliabilities to send/receive the mentions yourself, perhaps?
Wouter Groeneveld replied on via brainbaking.com
Zomg Max, congrats! Next step: getting rid of third-party reliabilities to send/receive the mentions yourself, perhaps?
Max Glenister replied on via social.omgmog.net
Sending this reply from a fresh instance of #Known
Simone Silvestroni mentioned on via minutestomidnight.co.uk
My method to implement Indieweb principles and add webmentions support to my Jekyll site is probably the laziest of all. It enabled a decentralized reply system, as well as allowing reposts and likes.
Max Glenister replied on via social.omgmog.net
Testing