This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/src/_includes/partials/webmentions.liquid

49 lines
2.7 KiB
Text

{% if webmentions %}
<div class="border-t border-gray-200 mt-12 pt-14 dark:border-gray-700">
{% assign mentions = webmentions.mentions | webmentionsByUrl: page.url %}
{% if mentions['repost-of'].size > 0 %}
<h2 class="text-lg md:text-xl font-black leading-tight dark:text-gray-200">Reposts</h2>
<div class="flex flex-row items-center mt-4 mb-6">
<ul class="ml-3 flex flex-row flex-wrap">
{% for mention in mentions['repost-of'] %}
<li class="-ml-3 inline">
<a href={{mention.url}}>
{% image mention.author.photo, mention.author.name, 'bg-gray-900 dark:bg-white h-14 w-14 rounded-full border-4 border-white dark:border-gray-900 transition-all hover:border-purple-500 dark:hover:border-purple-400', '56px' %}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if mentions['like-of'].size > 0 %}
<h2 class="text-lg md:text-xl font-black leading-tight dark:text-gray-200">Likes</h2>
<div class="flex flex-row items-center mt-4 mb-6">
<ul class="ml-3 flex flex-row flex-wrap">
{% for mention in mentions['like-of'] %}
<li class="-ml-3 inline">
<a href={{mention.url}}>
{% image mention.author.photo, mention.author.name, 'bg-gray-900 dark:bg-white h-14 w-14 rounded-full border-4 border-white dark:border-gray-900 transition-all hover:border-purple-500 dark:hover:border-purple-400', '56px' %}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if mentions['in-reply-to'].size > 0 %}
<h2 class="text-lg md:text-xl font-black leading-tight dark:text-gray-200">Comments</h2>
<div class="mt-4 flex flex-col items-center not-prose">
{% for mention in mentions['in-reply-to'] %}
<div class="border-bottom flex flex-row items-center border-gray-100 pb-4 w-full">
<a class="text-gray-700 dark:text-gray-200 group flex flex-row space-between items-center" href={{mention.url}}>
{% image mention.author.photo, mention.author.name, 'bg-gray-900 dark:bg-white h-14 w-14 rounded-full border-4 border-white dark:border-gray-900 transition-all group-hover:border-purple-500 dark:group-hover:border-purple-400', '56px' %}
<div class="ml-3">
<p class="text-sm group-hover:text-purple-500 dark:group-hover:text-purple-400">{{ mention.content.text }}</p>
<p class="mt-1 text-xs group-hover:text-purple-500 dark:group-hover:text-purple-400">{{ mention.published | isoDateOnly }}</p>
</div>
</a>
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}