Add Webmention Support

Published on

With many thanks to Using Web Mentions in a static site (Hugo), published by Paul Kinlan in October 2019, I have added Webmention support to the site.

For now, I am using Webmention.io to handle the heavy lifting of providing the Webmention end-point, the same way the above-referenced article describes.

With only minor modifications to the Node.js script from the article, I can pull down all mentions for my domain from Webmention.io and save them out as Hugo data files in my data/webmentions folder. For now, this is a manual process that I trigger from my laptop. Eventually, I should be able to set up a cron job on a server to periodically fetch new mentions, add them to my Gitea repository, and then push them out to the Gitlab mirror so Netlify will automatically rebuild the site.

Further down the road, I plan to implement Micropub for the site. Once I have end-points for Micropub, it only makes sense to also self-host the end-point(s) for webmentions. At that point, either I will implement my own webmention end-point, or look into deploying the open source Webmention.io code on my own server.

If all goes well, once I get this post served up, I will be able to add in a webmention from Webmention Rocks! that will show up below.

Likes

Comments and Replies

Webmention Rocks!
Comment by Webmention Rocks! on Tue Dec 24, 2019
This test verifies that you accept a Webmention request that contains a valid source and target URL. To pass this test, your Webmention endpoint must return either HTTP 200, 201 or 202 along with the appropriate headers.

If your endpoint returns HTTP 201, then it MUST also return a Location header. If it returns HTTP 200 or 202, then it MUST NOT include a Location header.