Files
indiekit-endpoint-activitypub/views/partials/ap-quote-embed.njk
Ricardo c243b70629 feat: enriched media model with ALT badges (Release 3+4)
Change photo storage from bare URL strings to objects with url, alt,
width, height (AP) plus blurhash and focus (Mastodon API). Templates
handle both old string and new object format for backward compat.

Add ALT text badges on gallery images — click to expand the full
alt text in an overlay. Renders in both reader and explore views.

Also pass alt text through to lightbox and quote embed photos.

Bump version to 2.5.3.

Confab-Link: http://localhost:8080/sessions/e9d666ac-3c90-4298-9e92-9ac9d142bc06
2026-03-03 13:46:58 +01:00

43 lines
2.2 KiB
Plaintext

{# Quoted post embed — renders when a post quotes another post #}
{% if item.quote %}
<div class="ap-quote-embed">
<a href="{{ mountPath }}/admin/reader/post?url={{ item.quote.uid | urlencode }}" class="ap-quote-embed__link">
<header class="ap-quote-embed__author">
{% if item.quote.author.photo %}
<img src="{{ item.quote.author.photo }}" alt="" class="ap-quote-embed__avatar" loading="lazy" crossorigin="anonymous">
{% else %}
<span class="ap-quote-embed__avatar ap-quote-embed__avatar--default">{{ item.quote.author.name[0] | upper if item.quote.author.name else "?" }}</span>
{% endif %}
<div class="ap-quote-embed__author-info">
<div class="ap-quote-embed__name">{% if item.quote.author.nameHtml %}{{ item.quote.author.nameHtml | safe }}{% else %}{{ item.quote.author.name or "Unknown" }}{% endif %}</div>
{% if item.quote.author.handle %}
<div class="ap-quote-embed__handle">{{ item.quote.author.handle }}</div>
{% endif %}
</div>
{% if item.quote.published %}
<time datetime="{{ item.quote.published }}" class="ap-quote-embed__time" x-data x-relative-time>{{ item.quote.published | date("PPp") }}</time>
{% endif %}
</header>
{% if item.quote.name %}
<p class="ap-quote-embed__title">{{ item.quote.name }}</p>
{% endif %}
{% if item.quote.content and item.quote.content.html %}
<div class="ap-quote-embed__content">{{ item.quote.content.html | safe }}</div>
{% endif %}
{% if item.quote.photo and item.quote.photo.length > 0 %}
{% set qPhoto = item.quote.photo[0] %}
<div class="ap-quote-embed__media">
<img src="{{ qPhoto.url if qPhoto.url else qPhoto }}" alt="{{ qPhoto.alt if qPhoto.alt else '' }}" loading="lazy" class="ap-quote-embed__photo">
</div>
{% endif %}
</a>
</div>
{% elif item.quoteUrl %}
{# Fallback: quote not yet fetched — show as styled link #}
<div class="ap-quote-embed ap-quote-embed--pending">
<a href="{{ mountPath }}/admin/reader/post?url={{ item.quoteUrl | urlencode }}" class="ap-quote-embed__link">
Quoted post: {{ item.quoteUrl }}
</a>
</div>
{% endif %}