From 2558e9fe5752e0fc6a01a0c36c4a869a77018a26 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Wed, 25 Feb 2026 11:07:47 +0100 Subject: [PATCH] feat: CV hero uses plugin identity with site.author fallback CV page hero now checks cvPageConfig.identity before falling back to site.author, matching the homepage hero pattern. Social links use the shared socialIcon macro. --- _includes/components/cv-builder.njk | 34 +++++++++++++++++++++-------- cv.njk | 28 +++++++++++++++++------- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/_includes/components/cv-builder.njk b/_includes/components/cv-builder.njk index 4af77bf..bb0b608 100644 --- a/_includes/components/cv-builder.njk +++ b/_includes/components/cv-builder.njk @@ -6,39 +6,55 @@ {% set layout = cvPageConfig.layout or "single-column" %} {% set hasSidebar = cvPageConfig.sidebar and cvPageConfig.sidebar.length %} +{# CV identity — check cvPageConfig.identity first, fall back to site.author #} +{% set cvId = cvPageConfig.identity if (cvPageConfig and cvPageConfig.identity) else {} %} +{% set authorName = cvId.name or site.author.name %} +{% set authorAvatar = cvId.avatar or site.author.avatar %} +{% set authorTitle = cvId.title or site.author.title %} +{% 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 %} + {# Hero — rendered at top when enabled (default: true) #} {% if cvPageConfig.hero.enabled != false %}
{{ site.author.name }}

- {{ site.author.name }} + {{ authorName }}

- {% if site.author.title %} + {% if authorTitle %}

- {{ site.author.title }} + {{ authorTitle }}

{% endif %} - {% if site.author.bio %} + {% if authorBio %}

- {{ site.author.bio }} + {{ authorBio }}

{% endif %} - {% if cvPageConfig.hero.showSocial != false %} + {% if authorDescription %} +

+ {{ authorDescription }} +

+ {% endif %} + {% from "components/social-icon.njk" import socialIcon %} + {% if cvPageConfig.hero.showSocial != false and socialLinks %}
- {% for link in site.social %} + {% for link in socialLinks %} + {{ socialIcon(link.icon, "w-5 h-5") }} {{ link.name }} {% endfor %} diff --git a/cv.njk b/cv.njk index e55d789..2e2f9d8 100644 --- a/cv.njk +++ b/cv.njk @@ -21,41 +21,53 @@ pagefindIgnore: true {# Fallback — hardcoded layout for backward compatibility #} {% else %} + {# CV identity — check cvPageConfig.identity first, fall back to site.author #} + {% set cvId = cvPageConfig.identity if (cvPageConfig and cvPageConfig.identity) else {} %} + {% set authorName = cvId.name or site.author.name %} + {% set authorAvatar = cvId.avatar or site.author.avatar %} + {% 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 %} + {# Hero / intro #}
{{ site.author.name }}

- {{ site.author.name }} + {{ authorName }}

- {% if site.author.title %} + {% if authorTitle %}

- {{ site.author.title }} + {{ authorTitle }}

{% endif %} - {% if site.author.bio %} + {% if authorBio %}

- {{ site.author.bio }} + {{ authorBio }}

{% endif %} + {% from "components/social-icon.njk" import socialIcon %} + {% if socialLinks %}
- {% for link in site.social %} + {% for link in socialLinks %} + {{ socialIcon(link.icon, "w-5 h-5") }} {{ link.name }} {% endfor %}
+ {% endif %}