{# 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 #} {% if mentions.length %}

Webmentions ({{ mentions.length }})

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

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

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

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

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

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

{% for bookmark in bookmarks %} {{ bookmark.author.name }} {% endfor %}
{% endif %} {# Replies #} {% set replies = mentions | webmentionsByType('replies') %} {% if replies.length %}

{{ replies.length }} Repl{% if replies.length != 1 %}ies{% else %}y{% 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 #}

Send a Webmention

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