fix: use hidden data element for reliable u-photo microformat parsing

Some microformat parsers have trouble detecting u-photo when the img is
inside an anchor tag or gets transformed by image processing. Added a
hidden <data class="u-photo"> element at the h-card root that parsers
reliably detect. Removed redundant u-photo class from visible img tags.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ricardo
2026-01-30 17:26:11 +01:00
parent d6640d515d
commit 70c66220b8

View File

@@ -10,6 +10,9 @@
{% set variant = hcardVariant | default("full") %}
<div class="h-card p-author" itemscope itemtype="http://schema.org/Person">
{# Hidden u-photo for reliable microformat parsing (some parsers struggle with img inside links) #}
<data class="u-photo hidden" value="{{ site.author.avatar }}"></data>
{% if variant == "full" %}
{# ===== FULL VARIANT - Homepage sidebar ===== #}
<div class="flex items-center gap-4">
@@ -17,7 +20,7 @@
<img
src="{{ site.author.avatar }}"
alt="{{ site.author.name }}"
class="u-photo w-16 h-16 rounded-full object-cover"
class="w-16 h-16 rounded-full object-cover"
loading="lazy"
itemprop="image"
>
@@ -82,7 +85,7 @@
<img
src="{{ site.author.avatar }}"
alt="{{ site.author.name }}"
class="u-photo w-12 h-12 rounded-full object-cover"
class="w-12 h-12 rounded-full object-cover"
loading="lazy"
>
</a>