diff --git a/js/social-threads.js b/js/social-threads.js index 1a84836..9756522 100644 --- a/js/social-threads.js +++ b/js/social-threads.js @@ -97,6 +97,13 @@ document.addEventListener("alpine:init", () => { published: s.created_at, favourites: s.favourites_count || 0, })); + + // Remove webmention cards (build-time or client-fetched) that duplicate mastodon replies. + // Webmention cards have data-author-url; Alpine x-for cards do not. + const mastodonAuthorUrls = new Set(this.mastodonReplies.map((r) => r.author.url)); + document.querySelectorAll(".webmention-replies li[data-author-url]").forEach((li) => { + if (mastodonAuthorUrls.has(li.dataset.authorUrl)) li.remove(); + }); } catch { // fail silently }