Files
indiekit-endpoint-microsub/views/partials/author.njk
Ricardo 1512bcecb2 feat: add CSS stacking avatar fallback to all templates (v1.0.49)
Phase 3 frontend harmonization: apply the same avatar fallback pattern
used in ActivityPub to all Microsub templates. A fallback initials span
is always rendered; when the <img> loads, it covers the fallback via
absolute positioning. Broken images are removed by event delegation,
revealing the initials underneath.

Templates updated: item-card, item, actor, author (3 avatar sizes:
40px card, 48px detail, 80px profile). Error delegation script added
to reader layout.

Confab-Link: http://localhost:8080/sessions/bb4a6ec4-b711-48cd-b3d7-942ec2a9851d
2026-03-13 13:53:45 +01:00

21 lines
687 B
Plaintext

{# Author display #}
{% if author %}
<div class="author">
<div class="ms-item__avatar-wrap" data-avatar-fallback>
{% if author.photo %}
<img src="{{ author.photo }}" alt="" class="author__photo" width="48" height="48" loading="lazy">
{% endif %}
<span class="ms-item__author-photo ms-item__author-photo--default" aria-hidden="true">{{ author.name[0] | upper if author.name else "?" }}</span>
</div>
<div class="author__info">
<span class="author__name">
{% if author.url %}
<a href="{{ author.url }}">{{ author.name or author.url }}</a>
{% else %}
{{ author.name or "Unknown" }}
{% endif %}
</span>
</div>
</div>
{% endif %}