From 69a0442aa5a4411b19904f29108dd3d1177c9780 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sat, 14 Mar 2026 20:05:23 +0100 Subject: [PATCH] fix(widgets): use full Bluesky self-filter logic for sidebar webmentions (did:plc + bsky.app/profile) --- _includes/components/widgets/webmentions.njk | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/_includes/components/widgets/webmentions.njk b/_includes/components/widgets/webmentions.njk index 5777fdf..2563be5 100644 --- a/_includes/components/widgets/webmentions.njk +++ b/_includes/components/widgets/webmentions.njk @@ -150,15 +150,17 @@ function webmentionsWidget() { merged.push(item); } - // Filter out webmentions from own Bluesky handle - const filtered = merged.filter((item) => { - const authorUrl = item.author && item.author.url ? item.author.url : ''; - // Bluesky profile URLs can be at:// or https://bsky.app/profile/ or handle - return !( - authorUrl.includes('svemagie.bsky.social') || - (item.author && item.author.name && item.author.name.toLowerCase() === 'svemagie.bsky.social') - ); - }); + // Use same self-Bluesky filter as post-interactions/interactions.njk + const isSelfBsky = (item) => { + const u = (item.url || '').toLowerCase(); + const a = ((item.author && item.author.url) || '').toLowerCase(); + return u.includes('did:plc:g4utqyolpyb5zpwwodmm3hht') || + u.includes('bsky.app/profile/svemagie.bsky.social') || + a.includes('did:plc:g4utqyolpyb5zpwwodmm3hht') || + a.includes('bsky.app/profile/svemagie.bsky.social'); + }; + + const filtered = merged.filter((item) => !isSelfBsky(item)); this.mentions = filtered.sort((a, b) => { return new Date(b.published || b['wm-received'] || 0) - new Date(a.published || a['wm-received'] || 0);