fix: CV page hero issues — avatar 404, collapsible description, interest filter, contact info

- Add eleventy:ignore to avatar img to prevent image transform rewriting URL to broken relative path
- Wrap authorDescription in details/summary for collapsible "More about me" toggle
- Fix interest filter logic: untyped interests no longer bypass work/personal filter
- Display location, org, website, email, PGP key from CV identity in hero section
This commit is contained in:
Ricardo
2026-02-25 12:26:03 +01:00
parent 2558e9fe57
commit 116ac63f5f
3 changed files with 64 additions and 4 deletions

View File

@@ -14,6 +14,12 @@
{% set authorBio = cvId.bio or site.author.bio %}
{% set authorDescription = cvId.description or '' %}
{% set socialLinks = cvId.social if (cvId.social and cvId.social.length) else site.social %}
{% set cvLocality = cvId.locality or site.author.locality %}
{% set cvCountry = cvId.country or site.author.country %}
{% set cvOrg = cvId.org or site.author.org %}
{% set cvUrl = cvId.url or '' %}
{% set cvEmail = cvId.email or site.author.email %}
{% set cvKeyUrl = cvId.keyUrl or site.author.keyUrl %}
{# Hero — rendered at top when enabled (default: true) #}
{% if cvPageConfig.hero.enabled != false %}
@@ -24,6 +30,7 @@
alt="{{ authorName }}"
class="w-24 h-24 sm:w-32 sm:h-32 rounded-full object-cover shadow-lg flex-shrink-0"
loading="eager"
eleventy:ignore
>
<div class="flex-1 min-w-0">
<h1 class="text-2xl sm:text-3xl md:text-4xl font-bold text-surface-900 dark:text-surface-100 mb-2">
@@ -40,9 +47,14 @@
</p>
{% endif %}
{% if authorDescription %}
<p class="text-base sm:text-lg text-surface-700 dark:text-surface-300 mb-4 sm:mb-6">
{{ authorDescription }}
</p>
<details class="mb-4 sm:mb-6">
<summary class="text-sm font-medium text-primary-600 dark:text-primary-400 cursor-pointer hover:underline list-none">
More about me &darr;
</summary>
<p class="text-base sm:text-lg text-surface-700 dark:text-surface-300 mt-3">
{{ authorDescription }}
</p>
</details>
{% endif %}
{% from "components/social-icon.njk" import socialIcon %}
{% if cvPageConfig.hero.showSocial != false and socialLinks %}
@@ -60,6 +72,26 @@
{% endfor %}
</div>
{% endif %}
{# Contact details — location, organization, website, email, PGP #}
{% if cvLocality or cvCountry or cvOrg or cvUrl or cvEmail or cvKeyUrl %}
<div class="flex flex-wrap gap-x-4 gap-y-1 mt-4 text-sm text-surface-500 dark:text-surface-400">
{% if cvLocality or cvCountry %}
<span>{% if cvLocality %}{{ cvLocality }}{% endif %}{% if cvLocality and cvCountry %}, {% endif %}{% if cvCountry %}{{ cvCountry }}{% endif %}</span>
{% endif %}
{% if cvOrg %}
<span>{{ cvOrg }}</span>
{% endif %}
{% if cvUrl %}
<span><a href="{{ cvUrl }}" class="text-primary-600 dark:text-primary-400 hover:underline" target="_blank" rel="noopener">{{ cvUrl | replace("https://", "") | replace("http://", "") }}</a></span>
{% endif %}
{% if cvEmail %}
<span><a href="mailto:{{ cvEmail }}" class="text-primary-600 dark:text-primary-400 hover:underline">{{ cvEmail }}</a></span>
{% endif %}
{% if cvKeyUrl %}
<span><a href="{{ cvKeyUrl }}" class="text-primary-600 dark:text-primary-400 hover:underline" target="_blank" rel="noopener">PGP Key</a></span>
{% endif %}
</div>
{% endif %}
</div>
</div>
</section>

View File

@@ -9,9 +9,10 @@
{{ section.config.title or "Interests" }}
</h2>
{% set hasTypeData = cv.interestTypes and (cv.interestTypes | dictsort | length > 0) %}
<div class="flex flex-wrap gap-2">
{% for interest in cv.interests %}
{% if not filterType or (cv.interestTypes and cv.interestTypes[interest] == filterType) or not cv.interestTypes or not cv.interestTypes[interest] %}
{% if not filterType or (hasTypeData and cv.interestTypes[interest] == filterType) or not hasTypeData %}
<span class="px-3 py-1.5 bg-white dark:bg-surface-800 border border-surface-200 dark:border-surface-700 rounded-full text-sm text-surface-700 dark:text-surface-300 hover:border-primary-400 dark:hover:border-primary-600 transition-colors">
{{ interest }}
</span>

27
cv.njk
View File

@@ -28,6 +28,12 @@ pagefindIgnore: true
{% set authorTitle = cvId.title or site.author.title %}
{% set authorBio = cvId.bio or site.author.bio %}
{% set socialLinks = cvId.social if (cvId.social and cvId.social.length) else site.social %}
{% set cvLocality = cvId.locality or site.author.locality %}
{% set cvCountry = cvId.country or site.author.country %}
{% set cvOrg = cvId.org or site.author.org %}
{% set cvUrl = cvId.url or '' %}
{% set cvEmail = cvId.email or site.author.email %}
{% set cvKeyUrl = cvId.keyUrl or site.author.keyUrl %}
{# Hero / intro #}
<section class="mb-8 sm:mb-12">
@@ -37,6 +43,7 @@ pagefindIgnore: true
alt="{{ authorName }}"
class="w-24 h-24 sm:w-32 sm:h-32 rounded-full object-cover shadow-lg flex-shrink-0"
loading="eager"
eleventy:ignore
>
<div class="flex-1 min-w-0">
<h1 class="text-2xl sm:text-3xl md:text-4xl font-bold text-surface-900 dark:text-surface-100 mb-2">
@@ -68,6 +75,26 @@ pagefindIgnore: true
{% endfor %}
</div>
{% endif %}
{# Contact details #}
{% if cvLocality or cvCountry or cvOrg or cvUrl or cvEmail or cvKeyUrl %}
<div class="flex flex-wrap gap-x-4 gap-y-1 mt-4 text-sm text-surface-500 dark:text-surface-400">
{% if cvLocality or cvCountry %}
<span>{% if cvLocality %}{{ cvLocality }}{% endif %}{% if cvLocality and cvCountry %}, {% endif %}{% if cvCountry %}{{ cvCountry }}{% endif %}</span>
{% endif %}
{% if cvOrg %}
<span>{{ cvOrg }}</span>
{% endif %}
{% if cvUrl %}
<span><a href="{{ cvUrl }}" class="text-primary-600 dark:text-primary-400 hover:underline" target="_blank" rel="noopener">{{ cvUrl | replace("https://", "") | replace("http://", "") }}</a></span>
{% endif %}
{% if cvEmail %}
<span><a href="mailto:{{ cvEmail }}" class="text-primary-600 dark:text-primary-400 hover:underline">{{ cvEmail }}</a></span>
{% endif %}
{% if cvKeyUrl %}
<span><a href="{{ cvKeyUrl }}" class="text-primary-600 dark:text-primary-400 hover:underline" target="_blank" rel="noopener">PGP Key</a></span>
{% endif %}
</div>
{% endif %}
</div>
</div>
</section>