{# Webmentions Component #} {# Displays likes, reposts, and replies for a post #} {# Also checks legacy URLs from micro.blog and old blog for historical webmentions #} {# Client-side JS supplements build-time data with real-time fetches #} {% set mentions = webmentions | webmentionsForUrl(page.url, urlAliases, conversationMentions) %} {% set absoluteUrl = site.url + page.url %} {% set buildTimestamp = "" | timestamp %} {# Data container for client-side JS to fetch new webmentions #} {# Detect Bluesky syndication URL here — needed to show section even without webmentions #} {% set bskySyndUrl = "" %} {% if syndication %} {% for url in syndication %} {% if "bsky.app" in url %}{% set bskySyndUrl = url %}{% endif %} {% endfor %} {% endif %} {% set mastodonInstance = site.feeds.mastodon.instance %} {% if mentions.length or bskySyndUrl or mastodonInstance %}

Interactions ({{ mentions.length }})

{# Likes #} {% set likes = mentions | webmentionsByType('likes') %} {% if likes.length %}

{{ likes.length }} Like{% if likes.length != 1 %}s{% endif %}

    {% for like in likes %}
  • {% endfor %}
{% endif %} {# Reposts #} {% set reposts = mentions | webmentionsByType('reposts') %} {% if reposts.length %}

{{ reposts.length }} Repost{% if reposts.length != 1 %}s{% endif %}

    {% for repost in reposts %}
  • {% endfor %}
{% endif %} {# Bookmarks #} {% set bookmarks = mentions | webmentionsByType('bookmarks') %} {% if bookmarks.length %}

{{ bookmarks.length }} Bookmark{% if bookmarks.length != 1 %}s{% endif %}

    {% for bookmark in bookmarks %}
  • {% endfor %}
{% endif %} {# Replies — webmention replies merged with Bluesky + Mastodon/AP threads (deduplicated) #} {% set wm_replies = mentions | webmentionsByType('replies') %} {# Activate Mastodon/AP thread fetching when instance is configured #} {% set apIdentity = site.fediverseCreator %} {% set mastodonActive = mastodonInstance %} {% set replyComponentActive = bskySyndUrl or mastodonActive %} {# Filter: remove Bluesky-sourced webmentions if bskySyndUrl; remove fed.brid.gy webmentions if mastodonActive #} {% set filtered_replies = [] %} {% for reply in wm_replies %} {% set src = reply['wm-source'] | default('') %} {% set includeReply = true %} {% if bskySyndUrl and ('bsky.app' in src or 'brid.gy' in src or 'bridgy' in src or 'bsky.app' in (reply.author.url | default(''))) %}{% set includeReply = false %}{% endif %} {% if mastodonActive and 'fed.brid.gy' in src %}{% set includeReply = false %}{% endif %} {% if includeReply %} {% set filtered_replies = (filtered_replies.push(reply), filtered_replies) %} {% endif %} {% endfor %} {% if filtered_replies.length or replyComponentActive %} {% set wmRepliesCount = filtered_replies.length %}

{% if not replyComponentActive %}{{ wmRepliesCount }} Repl{% if wmRepliesCount != 1 %}ies{% else %}y{% endif %}{% endif %}

{% endif %} {# Other mentions #} {% set otherMentions = mentions | webmentionsByType('mentions') %} {% if otherMentions.length %}

{{ otherMentions.length }} Mention{% if otherMentions.length != 1 %}s{% endif %}

{% endif %}
{% endif %} {# Webmention send form — collapsed by default #}
Send a Webmention

Have you written a response to this post? Send a webmention by entering your post URL below.