fix(webmentions): filter out self-interactions from own Bluesky account

Exclude webmentions from svemagie.bsky.social / did:plc:g4utqyolpyb5zpwwodmm3hht
at both build-time (eleventy filter) and client-side (webmentions.js).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-16 00:59:40 +01:00
parent 216073cf8f
commit 571ecb6e40
2 changed files with 21 additions and 2 deletions

View File

@@ -878,7 +878,17 @@ export default function (eleventyConfig) {
authorActions.add(key);
deduped.push(wm);
}
return deduped;
// Filter out self-interactions from own Bluesky account
const isSelfBsky = (wm) => {
const u = (wm.url || "").toLowerCase();
const a = (wm.author?.url || "").toLowerCase();
return u.includes("bsky.app/profile/svemagie.bsky.social") ||
u.includes("did:plc:g4utqyolpyb5zpwwodmm3hht") ||
a.includes("bsky.app/profile/svemagie.bsky.social") ||
a.includes("did:plc:g4utqyolpyb5zpwwodmm3hht");
};
return deduped.filter((wm) => !isSelfBsky(wm));
});
eleventyConfig.addFilter("webmentionsByType", function (mentions, type) {

View File

@@ -52,12 +52,21 @@
}
}
function isSelfBsky(wm) {
var u = (wm.url || '').toLowerCase();
var a = ((wm.author && wm.author.url) || '').toLowerCase();
return u.includes('bsky.app/profile/svemagie.bsky.social') ||
u.includes('did:plc:g4utqyolpyb5zpwwodmm3hht') ||
a.includes('bsky.app/profile/svemagie.bsky.social') ||
a.includes('did:plc:g4utqyolpyb5zpwwodmm3hht');
}
function processWebmentions(allChildren) {
if (!allChildren || !allChildren.length) return;
// Separate owner replies (threaded under parent) from regular interactions
var ownerReplies = allChildren.filter(function(wm) { return wm.is_owner && wm.parent_url; });
var regularItems = allChildren.filter(function(wm) { return !wm.is_owner; });
var regularItems = allChildren.filter(function(wm) { return !wm.is_owner && !isSelfBsky(wm); });
let mentionsToShow;
if (hasBuildTimeSection) {