This has probably been done a million times (and done better), but I quickly threw together a (for now) basic Webmention endpoint.

Validates target pages against a list of known URLs, which is not, uhm, a very generic solution. (We could, e.g., do a HEAD request instead.) Also, the actual “comments” are stored in a second table.

Now, what’s this good for? I dunno. Say I wanted to store my content as flat files but still support Webmention. Or any other source of comments, later on. Then I could process those dynamically, still, and (I think) splice ’em in during build.

Speaking of, this “list of known URLs” (a plain-text sitemap, kinda): let’s say I generate this halfway the build process, but keep its previous version as `pages.old.txt` or something. I could then diff both files and send outgoing webmentions (if applicable) for the couple pages that were added (or changed, or deleted, even). Hypothetically speaking and all.

Don’t need a database, per se. I’ve seen folks store comments in JSON, alongside (i.e., in the same subfolder as) a post’s markdown file. (But why wouldn’t we? It’s so easy.)

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!