diff --git a/assets/styles.css b/assets/styles.css index 5707741..da67e1b 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -154,15 +154,40 @@ margin-bottom: var(--space-s); } +.ms-item-card__avatar-wrap { + flex-shrink: 0; + height: 40px; + position: relative; + width: 40px; +} + +.ms-item-card__avatar-wrap > img { + position: absolute; + inset: 0; + z-index: 1; +} + .ms-item-card__author-photo { border: var(--border-width-thin) solid var(--color-offset); border-radius: 50%; - flex-shrink: 0; height: 40px; object-fit: cover; width: 40px; } +.ms-item-card__author-photo--default { + align-items: center; + background: var(--color-offset); + border-radius: 50%; + color: var(--color-on-offset); + display: flex; + font-size: var(--font-size-s); + font-weight: 600; + height: 40px; + justify-content: center; + width: 40px; +} + .ms-item-card__author-info { display: flex; flex-direction: column; @@ -496,6 +521,19 @@ margin-bottom: var(--space-m); } +.ms-item__avatar-wrap { + flex-shrink: 0; + height: 48px; + position: relative; + width: 48px; +} + +.ms-item__avatar-wrap > img { + position: absolute; + inset: 0; + z-index: 1; +} + .ms-item__author-photo { border-radius: 50%; height: 48px; @@ -503,6 +541,19 @@ width: 48px; } +.ms-item__author-photo--default { + align-items: center; + background: var(--color-offset); + border-radius: 50%; + color: var(--color-on-offset); + display: flex; + font-size: var(--font-size-m); + font-weight: 600; + height: 48px; + justify-content: center; + width: 48px; +} + .ms-item__author-info { display: flex; flex-direction: column; @@ -1010,12 +1061,37 @@ gap: var(--space-m); } +.ms-actor-profile__avatar-wrap { + flex-shrink: 0; + height: 80px; + position: relative; + width: 80px; +} + +.ms-actor-profile__avatar-wrap > img { + position: absolute; + inset: 0; + z-index: 1; +} + .ms-actor-profile__avatar { border-radius: 50%; - flex-shrink: 0; object-fit: cover; } +.ms-actor-profile__avatar--default { + align-items: center; + background: var(--color-offset); + border-radius: 50%; + color: var(--color-on-offset); + display: flex; + font-size: var(--font-size-xl); + font-weight: 600; + height: 80px; + justify-content: center; + width: 80px; +} + .ms-actor-profile__info { flex: 1; min-width: 0; diff --git a/package.json b/package.json index 8187355..f39812a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-microsub", - "version": "1.0.48", + "version": "1.0.49", "description": "Microsub endpoint for Indiekit. Enables subscribing to feeds and reading content using the Microsub protocol.", "keywords": [ "indiekit", diff --git a/views/actor.njk b/views/actor.njk index 9623275..fbf156d 100644 --- a/views/actor.njk +++ b/views/actor.njk @@ -11,13 +11,16 @@ {# Actor profile card #}
- {% if actor.photo %} - - {% endif %} +
+ {% if actor.photo %} + + {% endif %} + +

{{ actor.name }}

{% if actor.handle %} @@ -73,14 +76,17 @@ {# Author #} {% if item.author %}
- {% if item.author.photo %} - - {% endif %} +
+ {% if item.author.photo %} + + {% endif %} + +
{{ item.author.name or "Unknown" }} {% if item.author.url %} diff --git a/views/item.njk b/views/item.njk index 7dc2e5d..43741bf 100644 --- a/views/item.njk +++ b/views/item.njk @@ -8,14 +8,17 @@ {% if item.author %}
- {% if item.author.photo %} - - {% endif %} +
+ {% if item.author.photo %} + + {% endif %} + +
{% if item.author.url %} diff --git a/views/layouts/reader.njk b/views/layouts/reader.njk index 5651b72..66a4844 100644 --- a/views/layouts/reader.njk +++ b/views/layouts/reader.njk @@ -9,4 +9,6 @@ {% include "partials/breadcrumbs.njk" %} {% include "partials/view-switcher.njk" %} {% block reader %}{% endblock %} +{# Avatar fallback — remove broken images to reveal initials fallback underneath #} + {% endblock %} diff --git a/views/partials/author.njk b/views/partials/author.njk index 7741373..91527e9 100644 --- a/views/partials/author.njk +++ b/views/partials/author.njk @@ -1,9 +1,12 @@ {# Author display #} {% if author %}
- {% if author.photo %} - - {% endif %} +
+ {% if author.photo %} + + {% endif %} + +
{% if author.url %} diff --git a/views/partials/item-card.njk b/views/partials/item-card.njk index 4354152..4475de5 100644 --- a/views/partials/item-card.njk +++ b/views/partials/item-card.njk @@ -53,14 +53,17 @@ {# Author #} {% if item.author %}
- {% if item.author.photo %} - - {% endif %} +
+ {% if item.author.photo %} + + {% endif %} + +
{{ item.author.name or "Unknown" }} {% if item._source %}