Receive webmentions via form
We can enable visitors of our website to send us Webmentions even if their blogs don't support Webmentions. I'll explain how.
Webmentions are a great thing. They allow us to connect our blogs. The principle is quite simple:
If I mention another site in my blog post, I automatically send a message to a predefined URL of the mentioned blog when I publish that post. In it, I share both my post URL and the post URL of the recipient site. The recipient can continue working with this information.
If the recipient supports Webmentions, they respond to the message by checking whether the post I mentioned actually exists on their blog and then look at the URL of my post to retrieve the information they need to display my mention as a comment under their blog post.
What information they need and whether and how they display my mention is up to them. I've described in detail how this works here.
Depending on what you use to run your website, you may have to build this functionality yourself. And while it's not rocket science in itself, it's unfortunately not trivial, and in some cases, it's not even technically possible.
We, as site operators with integrated Webmentions, can help bloggers without them. It's quite simple, in fact!
Instead of assuming that all sites can automatically send a Webmention, we simply offer them the opportunity to inform us via a form. The principle is similar, except that if Blogger B sends us a URL from their site, they can copy their post URL into an input field and submit it.
We then receive two URLs: Blogger B's and our blog post's.
A simple form is sufficient:
<form method="POST" action="/webmention/ENDPOINT">
<input type="url" name="source" id="source" placeholder="https://your.blog/post" required>
<input type="hidden" name="target" value="<?= $page->url(); ?>">
<input type="submit" value="webmention">
</form>
As you can see, we send the form to the Webmention endpoint we already have. We have two fields: a URL field where Blogger B copies her post URL and a hidden field containing our post URL.
We simply send the form to the same endpoint where automatic Webmentions are sent. And so the regular process can continue.
To be able to read the necessary information accurately, blogs should label their data. This is easy to do with Microformats and works completely independently of Webmentions. This allows us to specify the title, the summary, and the author.
If your Kirby website doesn't yet support Webmentions, check out my IndieConnector, which will do the heavy lifting for you.
Write a comment