After writing about comments yesterday I’ve now implemented experimental support for comment-type mentions in webmentiond. Using Will Norris’s microformats parser for Go, the current implementation will look for an h-entry at the source-URL of the mention and use its p-name for the title
, e-content for the content
of the mention, and u-author for its author. All these properties will be stored inside the webmentions
table of the database. If the entry has a u-is-reply-to
link, then the whole mention will receive the type
comment
.
At this point, the content is truncated after 500 characters (or actually after 497 in order to always have a maximum of 500 characters) before being stored inside the database.
These new fields are also exposed in the relevant HTTP-API endpoints for each mention. You can see an example for this by looking at the response body of this request:
[
{
"id":"bq7jiguu9c2cnem5k8eg",
"source":"https://jlelse.blog/micro/2020/04/2020-04-09-eccgd/",
"target":"",
"created_at":"2020-04-09T15:03:31Z",
"status":"approved",
"title":"jlelse's Blog",
"content":"Some people don’t wear their mask over mouth and nose.That’s something I don’t understand at all. If some people wear masks, why don’t they wear them right? I see that sometimes when I go for a walk alone. People pass by me who have a mask over their mouth, but their nose is not covered.In order to generally avoid the narrowness in the supermarket more, I now only go shopping once a week at most and drive to a supermarket that is much bigger and where one can keep more distance than in the supermarket around the corner. Another advantage: The offer is also much better and there are still more of the things I want to buy. (But they didn’t have toilet paper either.)",
"author_name":"Jan-Lukas Else",
"type":"comment"
}
]
To use this new implementation, simply pull zerok/webmentiond:latest and restart your server 🙂
I’ve also updated the rendering of mentions on my blog, which makes the mention listed above to appear like this:
Do you want to give me feedback about this article in private? Please send it to comments@zerokspot.com.
Alternatively, this website also supports Webmentions. If you write a post on a blog that supports this technique, I should get notified about your link 🙂