upgrade to 3.0
This commit is contained in:
47
_includes/likes.njk
Normal file
47
_includes/likes.njk
Normal file
@@ -0,0 +1,47 @@
|
||||
{%- set likes = webmentions.children | likesForUrl(absoluteUrl) -%}
|
||||
{%- set reposts = webmentions.children | repostsForUrl(absoluteUrl) -%}
|
||||
|
||||
{% if likes.length > 0 %}
|
||||
<h4>{{ likes.length }} Like{% if likes.length != 1 %}s{% endif %}</h4>
|
||||
<div class="webmentions__facepile">
|
||||
{% for webmention in likes %}
|
||||
|
||||
{% if webmention.url != "" %}
|
||||
<a class="h-card u-url link-u-exempt" href="{{ webmention.url }}" target="_blank" rel="noopener noreferrer">
|
||||
{% endif %}
|
||||
|
||||
{% if webmention.author.photo %}
|
||||
<img src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" alt="" class="webmentions__face" loading="lazy" />
|
||||
{% else %}
|
||||
<img class="webmention__author__photo" src="{{ '/img/default_avatar.png' | url }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" alt="" class="webmentions__face" />
|
||||
{% endif %}
|
||||
|
||||
{% if webmention.url != "" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if reposts.length > 0 %}
|
||||
<h4>{{ reposts.length }} Repost{% if reposts.length != 1 %}s{% endif %}</h4>
|
||||
<div class="webmentions__facepile">
|
||||
{% for webmention in reposts %}
|
||||
{% if webmention.url != "" %}
|
||||
<a class="h-card u-url link-u-exempt" href="{{ webmention.url }}" target="_blank" rel="noopener noreferrer">
|
||||
{% endif %}
|
||||
|
||||
{% if webmention.author.photo %}
|
||||
<img src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" alt="" class="webmentions__face" loading="lazy" />
|
||||
{% else %}
|
||||
<img class="webmention__author__photo" src="{{ '/img/default_avatar.png' | url }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" alt="" class="webmentions__face" />
|
||||
{% endif %}
|
||||
{% if webmention.url != "" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user