mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
fix: use webmentions proxy in client-side fetcher
Prevents direct calls to webmention.io API which may fail without token Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Client-side webmention fetcher
|
||||
* Supplements build-time cached webmentions with real-time data from webmention.io
|
||||
* Supplements build-time cached webmentions with real-time data from proxy API
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -18,7 +18,8 @@
|
||||
if (sessionStorage.getItem(cacheKey)) return;
|
||||
sessionStorage.setItem(cacheKey, '1');
|
||||
|
||||
const apiUrl = `https://webmention.io/api/mentions.jf2?target=${encodeURIComponent(target)}&per-page=100`;
|
||||
// Use server-side proxy to keep webmention.io token secure
|
||||
const apiUrl = `/webmentions-api/api/mentions?target=${encodeURIComponent(target)}&per-page=100`;
|
||||
|
||||
fetch(apiUrl)
|
||||
.then((res) => res.json())
|
||||
|
||||
Reference in New Issue
Block a user