Bye Disqus, hello Webmention!

Since 2013 I’ve used Disqus on this website for comments. Over the years Disqus has been getting ‘fatter’, so I’ve been thinking of switching to something new.

Then on Friday, I saw a tweet which got me inspired:

This links to Nicolas Hoizey’s blog, in which he details moving his Github Pages-based blog from Disqus to Webmentions. I spent all day Saturday to do the same.

What are webmentions?

Webmentions is a W3C standard for distributed commenting. It’s very similar to “Pingbacks”. When somebody wants to respond to an article here from their own blog, a link will be created automatically.

I used the hosted service to do this. To receive webmentions, I just needed to embed the following in the <head> of this site:

<link rel="pingback" href="" />
<link rel="webmention" href="" />

The site has a simple API, with open CORS headers. I wrote a custom script to get the webmentions embedded in this blog. source is on github.

Importing old comments

I exported the disqus comments, and wrote a script to convert them into JSON. The source for the exporter is reusable. I also put it on github if anyone finds it useful.

The last time I switch blogging systems I used Habari, but also never got around importing comments. I took the time to import those as well, so now comments all the way from 2006 are back!

Jekyll has a ‘data files’ feature, which allows me to just drop the json file in a _data directory, and with a recursive liquid include I can show comments and threads:

Unfortunately Disqus has no means to get an email address, url or avatar from the export, so all Disqus comments are now just show up as a boring name, as can be seen here.

If you ever commented on this site with Disqus, and want to show up with a url and/or avatar find yourself in the comment archive on github and send me a PR, or just tell me!

Getting tweets and likes from twitter

To get mentions from social media, like Twitter, I’m using Bridgy. This is a free service that listens for responses to tweets and converts them to Web mentions.

It also supports other networks, but Twitter is the only one I have setup. To see it in action, you can see a bunch of twitter responses right below this article.

What’s missing?

It’s not easy currently to discover on this site that Webmentions are possible, and it’s it’s not possible to leave a regular comment anymore. I hope I can fix both of these in the future. I think the result is that the barrier to entry has become very high, and I’d like to see if it’s possible for me to reduce that again. How would you go about it? does not have good spam protection. Spam was a major issue with pingbacks, and is pretty much why pingbacks died. Webmention is not big enough for this to be an issue, but if Webmentions grow, the spam issue has to be solved.

Lastly, this blog does not yet do outgoing Web mentions. There’s no obvious way to do this with a static site generator either, so my intent is to write a small crawler that takes links from blogposts, finds webmention links and automatically call their webmention api.

I intend to just run this crawler manually when I publish new posts.

Web mentions