diff --git a/_includes/components/webmentions.njk b/_includes/components/webmentions.njk index fd10de6..82b24a1 100644 --- a/_includes/components/webmentions.njk +++ b/_includes/components/webmentions.njk @@ -12,6 +12,8 @@ data-target="{{ absoluteUrl }}" data-domain="{{ site.webmentions.domain }}" data-buildtime="{{ buildTimestamp }}" + data-mastodon-active="{{ 'true' if mastodonInstance else '' }}" + data-bsky-url="{{ bskySyndUrl }}" class="hidden"> {# Detect Bluesky syndication URL here — needed to show section even without webmentions #} diff --git a/js/webmentions.js b/js/webmentions.js index 2ed43c1..04a8efd 100644 --- a/js/webmentions.js +++ b/js/webmentions.js @@ -10,6 +10,8 @@ const target = container.dataset.target; const domain = container.dataset.domain; const buildTime = parseInt(container.dataset.buildtime, 10) || 0; + const mastodonActive = container.dataset.mastodonActive === 'true'; + const bskyUrl = container.dataset.bskyUrl || ''; if (!target || !domain) return; @@ -66,7 +68,15 @@ // 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 && !isSelfBsky(wm); }); + var regularItems = allChildren.filter(function(wm) { + if (wm.is_owner || isSelfBsky(wm)) return false; + var src = (wm['wm-source'] || '').toLowerCase(); + var authorUrl = ((wm.author && wm.author.url) || '').toLowerCase(); + // Mirror Nunjucks build-time filters: skip platform replies handled by Alpine + if (mastodonActive && src.includes('fed.brid.gy')) return false; + if (bskyUrl && (src.includes('bsky.app') || src.includes('brid.gy/bluesky') || authorUrl.includes('bsky.app'))) return false; + return true; + }); let mentionsToShow; if (hasBuildTimeSection) {