From c66a46e349fa8f7b9f8df2061180e4ddcd0b6b6f Mon Sep 17 00:00:00 2001 From: Ricardo Date: Tue, 24 Feb 2026 15:37:19 +0100 Subject: [PATCH] feat: convert projects section to collapsible accordion Project cards now show a compact summary row (name, status badge, date range, chevron) that expands on click to reveal description and tech tags. Uses Alpine.js with independent toggles and smooth transitions. --- _includes/components/sections/cv-projects.njk | 110 ++++++++++++------ 1 file changed, 72 insertions(+), 38 deletions(-) diff --git a/_includes/components/sections/cv-projects.njk b/_includes/components/sections/cv-projects.njk index e364847..971c779 100644 --- a/_includes/components/sections/cv-projects.njk +++ b/_includes/components/sections/cv-projects.njk @@ -1,5 +1,5 @@ {# - CV Projects Section - project cards + CV Projects Section - collapsible project cards (accordion) Data fetched from /cv/data.json via homepage plugin #} @@ -8,52 +8,86 @@ {% set showTechnologies = sectionConfig.showTechnologies if sectionConfig.showTechnologies is defined else true %} {% if cv and cv.projects and cv.projects.length %} -
+

{{ sectionConfig.title or "Projects" }}

{% for item in cv.projects | head(maxItems) %} -
-
-

- {% if item.url %} - {{ item.name }} - {% else %} - {{ item.name }} +
+ {# Summary row — always visible, clickable #} +

- {% if item.status %} - - {{ item.status }} - +
+
+ {% if item.startDate %} + + {% endif %} + + + +
+ + + {# Detail section — collapsible #} +
+ {% if item.startDate %} +

+ {{ item.startDate }}{% if item.endDate %} – {{ item.endDate }}{% else %} – Present{% endif %} +

+ {% endif %} + + {% if item.description %} +

{{ item.description }}

+ {% endif %} + + {% if showTechnologies and item.technologies and item.technologies.length %} +
+ {% for tech in item.technologies %} + + {{ tech }} + + {% endfor %} +
{% endif %}
- - {% if item.startDate %} -

- {{ item.startDate }}{% if item.endDate %} – {{ item.endDate }}{% else %} – Present{% endif %} -

- {% endif %} - - {% if item.description %} -

{{ item.description }}

- {% endif %} - - {% if showTechnologies and item.technologies and item.technologies.length %} -
- {% for tech in item.technologies %} - - {{ tech }} - - {% endfor %} -
- {% endif %}
{% endfor %}