This simple PHP script fetches Webmentions from webmention.io, caches them locally, and displays them on your HTMLy blog.
- Fetches latest Webmentions for your domain via webmention.io API
- Caches responses locally for improved performance and reduced API calls
- Easy integration with your HTMLy theme
- Minimal dependencies, pure PHP
-
Clone or download this repository into your HTMLy blog directory or theme folder.
-
Make sure the
cache/
folder exists and is writable by your web server. -
Edit
webmention-cache.php
and set your domain in the$domain
variable. -
Include the
webmention-cache.php
in your theme layout where you want the Webmentions to appear:<?php include __DIR__ . '/webmention-cache.php'; ?>
-
Add the Webmention link tag to your HTML
<head>
(e.g. inlayout.html.php
):<link rel="webmention" href="https://webmention.io/yourdomain.com/webmention" />
Just visit your blog — Webmentions will be fetched and displayed automatically.
MIT License — feel free to use and modify.
Created by piehnat