fix webmentions & css

This commit is contained in:
Kathleen Fitzpatrick
2024-11-29 11:14:42 -05:00
parent d3997cbfb2
commit 891ed350b9
12 changed files with 7431 additions and 82 deletions

View File

@@ -31,7 +31,10 @@
{#- Add an arbitrary string to the bundle #}
{%- css %}/* This is an arbitrary CSS string added to the bundle */{% endcss %}
{#- Add the contents of a file to the bundle #}
{%- css %}{% include "public/css/index.css" %}{% endcss %}
{% css %}{% include "public/css/index.css" %}{% endcss %}
{% css %}{% include "public/css/webmentions.css" %}{% endcss %}
{% css %}{% include "public/css/message-box.css" %}{% endcss %}
{% css %}{% include "public/css/prism-diff.css" %}{% endcss %}
{#- Or you can add from node_modules #}
{# {%- css %}{% include "node_modules/prismjs/themes/prism-okaidia.css" %}{% endcss %} #}

View File

@@ -27,7 +27,8 @@ layout: layouts/base.njk
<hyvor-talk-comments website-id="9100" page-id="{{ permalink }}"></hyvor-talk-comments>
{% include 'webmentionlist.njk' %}
{% include 'webmentions.njk' %}
{%- endif %}
{%- endif %}

View File

@@ -5,37 +5,36 @@
<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" />
<img eleventy:ignore class="webmention__author__photo" src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" 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" />
<img eleventy:ignore class="webmention__author__photo" src="{{ '/img/default_avatar.png' | url }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" class="webmentions__face" />
{% endif %}
{% if webmention.url != "" %}
</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if reposts.length > 0 %}
{% 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" />
<img eleventy:ignore class="webmention__author__photo" src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" 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" />
<img eleventy:ignore class="webmention__author__photo" src="{{ '/img/default_avatar.png' | url }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" class="webmentions__face" />
{% endif %}
{% if webmention.url != "" %}
</a>

View File

@@ -3,19 +3,19 @@
{% if webmention.author %}
<a class="webmention__author p-author h-card u-url" href="{{ webmention.url }}" target="_blank" rel="noopener noreferrer">
{% if webmention.author.photo %}
<img class="webmention__author__photo u-photo" src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}">
<img eleventy:ignore class="webmention__author__photo u-photo" src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}">
{% else %}
<img class="webmention__author__photo" src="{{ '/img/webmention-avatar-default.svg' | url }}" alt="">
<img eleventy:ignore class="webmention__author__photo" src="{{ '/blog/img/default_avatar.png' | url }}" alt="">
{% endif %}
<strong class="p-name">{{ webmention.author.name }}</strong>
</a>
{% else %}
<span class="webmention__author">
<img class="webmention__author__photo" src="{{ '/img/webmention-avatar-default.svg' | url }}" alt="">
<img class="webmention__author__photo" src="{{ '/blog/img/default_avatar.png' | url }}" alt="">
<strong>Anonymous</strong>
</span>
{% endif %}
{% if webmention.published %}
<time class="webmention__pubdate dt-published" datetime="{{ webmention.published }}">{{ webmention.published | dateFromTimestamp | readableDate("dd LLL yyyy - HH:mm") }}</time>
{% endif %}
@@ -23,4 +23,4 @@
<div class="webmention__content p-content">
{{ webmention.content.text | safe }}
</div>
</article>
</article>

View File

@@ -1,22 +1,22 @@
{%- set absoluteUrl -%}{{ page.url | url | absoluteUrl(metadata.url) }}{%- endset -%}
{%- set mentions = webmentions.children | mentionsForUrl(absoluteUrl) -%}
<div class="webmentions" id="webmentions">
<h3>Webmentions</h3>
<h3>Webmentions</h3>
{% if mentions | length %}
<h4>{{ mentions.length }} {% if mentions.length == "1" %}Reply{% else %}Replies{% endif %}</h4>
{% if mentions | length %}
<h4>{{ mentions.length }} {% if mentions.length == "1" %}Reply{% else %}Replies{% endif %}</h4>
<ol class="webmentions__list">
{% for webmention in mentions | reverse %}
{% for webmention in mentions | reverse %}
<li class="webmentions__item">
{% include 'webmention.njk' %}
{% include 'webmention.njk' %}
</li>
{% endfor %}
{% endfor %}
</ol>
{% else %}
{% else %}
<p>No replies yet.</p>
{% endif %}
{% endif %}
{% include 'likes.njk' %}
</div>
</div>