diff options
Diffstat (limited to 'micro.pinapelz.moe/posts/2025-12-01-hello-world/index.html')
| -rw-r--r-- | micro.pinapelz.moe/posts/2025-12-01-hello-world/index.html | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/micro.pinapelz.moe/posts/2025-12-01-hello-world/index.html b/micro.pinapelz.moe/posts/2025-12-01-hello-world/index.html index 3fc9e8b..8613577 100644 --- a/micro.pinapelz.moe/posts/2025-12-01-hello-world/index.html +++ b/micro.pinapelz.moe/posts/2025-12-01-hello-world/index.html @@ -210,6 +210,7 @@ AtProto allows you to host a <code>PDS (Personal Data Server)</code> which store </style> <script> +const PAGE_URL = "https:\/\/micro.pinapelz.moe\/posts\/2025-12-01-hello-world\/"; async function loadMentions() { const url = "https://webmention.io/api/mentions.jf2?domain=micro.pinapelz.moe&token=hdjQAqlZwgJmSuPSiU8h8w"; @@ -220,12 +221,28 @@ async function loadMentions() { const container = document.getElementById("mentions"); container.innerHTML = ""; - if (!data.children || data.children.length === 0) { + const mentions = data.children.filter(m => { + const t = m["wm-target"]; + const inReply = m["in-reply-to"]; + const likeOf = m["like-of"]; + const repostOf = m["repost-of"]; + const mentionOf = m["mention-of"]; + + return ( + t === PAGE_URL || + inReply === PAGE_URL || + likeOf === PAGE_URL || + repostOf === PAGE_URL || + mentionOf === PAGE_URL + ); + }); + + if (!mentions.length) { container.innerHTML = "<p>No webmentions yet.</p>"; return; } - data.children.forEach(m => { + mentions.forEach(m => { const div = document.createElement("div"); div.className = "wm"; |
