diff --git a/_includes/components/h-card.njk b/_includes/components/h-card.njk index 3151a6d..638510a 100644 --- a/_includes/components/h-card.njk +++ b/_includes/components/h-card.njk @@ -4,83 +4,98 @@ This is the canonical h-card component for the site. Include in sidebar widgets, author cards, etc. #} +{% set id = homepageConfig.identity if (homepageConfig and homepageConfig.identity) else {} %} +{% set authorName = id.name or site.author.name %} +{% set authorAvatar = id.avatar or site.author.avatar %} +{% set authorTitle = id.title or site.author.title %} +{% set authorBio = id.bio or site.author.bio %} +{% set authorUrl = id.url or site.author.url %} +{% set authorPronoun = id.pronoun or site.author.pronoun %} +{% set authorLocality = id.locality or site.author.locality %} +{% set authorCountry = id.country or site.author.country %} +{% set authorLocation = site.author.location %} +{% set authorOrg = id.org or site.author.org %} +{% set authorEmail = id.email or site.author.email %} +{% set authorKeyUrl = id.keyUrl or site.author.keyUrl %} +{% set authorCategories = id.categories if (id.categories and id.categories.length) else site.author.categories %} +{% set socialLinks = id.social if (id.social and id.social.length) else site.social %}
{# Hidden u-photo for reliable microformat parsing (some parsers struggle with img inside links) #} - +
-
- - {{ site.author.name }} + + {{ authorName }} - {% if site.author.pronoun %} - ({{ site.author.pronoun }}) + {% if authorPronoun %} + ({{ authorPronoun }}) {% endif %} -

{{ site.author.title }}

+

{{ authorTitle }}

{# Structured address #}

- {% if site.author.locality %} - {{ site.author.locality }}{% if site.author.country %}, {% endif %} + {% if authorLocality %} + {{ authorLocality }}{% if authorCountry %}, {% endif %} {% endif %} - {% if site.author.country %} - {{ site.author.country }} + {% if authorCountry %} + {{ authorCountry }} {% endif %} {# Fallback to legacy location field #} - {% if not site.author.locality and site.author.location %} - {{ site.author.location }} + {% if not authorLocality and authorLocation %} + {{ authorLocation }} {% endif %}

{# Bio #} -

{{ site.author.bio }}

+

{{ authorBio }}

{# Organization #} - {% if site.author.org %} + {% if authorOrg %}

- {{ site.author.org }} + {{ authorOrg }}

{% endif %} {# Email and PGP Key #}
- {% if site.author.email %} + {% if authorEmail %} {# Display text obfuscated to deter spam harvesters; href kept plain for browser compatibility #} - - ✉️ {{ site.author.email | obfuscateEmail | safe }} + + ✉️ {{ authorEmail | obfuscateEmail | safe }} {% endif %} - {% if site.author.keyUrl %} - + {% if authorKeyUrl %} + 🔐 PGP Key {% endif %}
{# Categories / Skills #} - {% if site.author.categories and site.author.categories.length %} + {% if authorCategories and authorCategories.length %}
- {% for category in site.author.categories %} + {% for category in authorCategories %} {{ category }} {% endfor %}
{% endif %} {# Social links with rel="me" - critical for IndieWeb identity verification #} - {% if site.social and site.social.length %} + {% if socialLinks and socialLinks.length %}