feat: add personal/work project section templates
- cv-projects-personal.njk: filters projects with projectType=personal (or unset) - cv-projects-work.njk: filters projects with projectType=work - CV page now only shows work projects - Homepage section dispatcher routes both new types Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,10 @@
|
|||||||
{% include "components/sections/cv-experience.njk" ignore missing %}
|
{% include "components/sections/cv-experience.njk" ignore missing %}
|
||||||
{% elif section.type == "cv-projects" %}
|
{% elif section.type == "cv-projects" %}
|
||||||
{% include "components/sections/cv-projects.njk" ignore missing %}
|
{% include "components/sections/cv-projects.njk" ignore missing %}
|
||||||
|
{% elif section.type == "cv-projects-personal" %}
|
||||||
|
{% include "components/sections/cv-projects-personal.njk" ignore missing %}
|
||||||
|
{% elif section.type == "cv-projects-work" %}
|
||||||
|
{% include "components/sections/cv-projects-work.njk" ignore missing %}
|
||||||
{% elif section.type == "cv-skills" %}
|
{% elif section.type == "cv-skills" %}
|
||||||
{% include "components/sections/cv-skills.njk" ignore missing %}
|
{% include "components/sections/cv-skills.njk" ignore missing %}
|
||||||
{% elif section.type == "cv-education" %}
|
{% elif section.type == "cv-education" %}
|
||||||
|
|||||||
70
_includes/components/sections/cv-projects-personal.njk
Normal file
70
_includes/components/sections/cv-projects-personal.njk
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
{#
|
||||||
|
CV Personal Projects Section - filters projects by projectType == "personal" (or unset)
|
||||||
|
Data fetched from /cv/data.json via homepage plugin
|
||||||
|
#}
|
||||||
|
|
||||||
|
{% set sectionConfig = section.config or {} %}
|
||||||
|
{% set maxItems = sectionConfig.maxItems or 10 %}
|
||||||
|
{% set showTechnologies = sectionConfig.showTechnologies if sectionConfig.showTechnologies is defined else true %}
|
||||||
|
|
||||||
|
{% set personalProjects = [] %}
|
||||||
|
{% if cv and cv.projects %}
|
||||||
|
{% for item in cv.projects %}
|
||||||
|
{% if item.projectType == "personal" or not item.projectType %}
|
||||||
|
{% set personalProjects = (personalProjects.push(item), personalProjects) %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if personalProjects.length %}
|
||||||
|
<section class="mb-8 sm:mb-12" id="personal-projects">
|
||||||
|
<h2 class="text-xl sm:text-2xl font-bold text-surface-900 dark:text-surface-100 mb-4 sm:mb-6">
|
||||||
|
{{ sectionConfig.title or "Personal Projects" }}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||||
|
{% for item in personalProjects | head(maxItems) %}
|
||||||
|
<div class="p-4 bg-white dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 hover:border-primary-400 dark:hover:border-primary-600 transition-colors">
|
||||||
|
<div class="flex items-start justify-between gap-2 mb-1">
|
||||||
|
<h3 class="font-semibold text-surface-900 dark:text-surface-100">
|
||||||
|
{% if item.url %}
|
||||||
|
<a href="{{ item.url }}" class="hover:text-primary-600 dark:hover:text-primary-400">{{ item.name }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ item.name }}
|
||||||
|
{% endif %}
|
||||||
|
</h3>
|
||||||
|
{% if item.status %}
|
||||||
|
<span class="shrink-0 text-xs px-2 py-0.5 rounded-full capitalize
|
||||||
|
{% if item.status == 'active' %}bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300
|
||||||
|
{% elif item.status == 'maintained' %}bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300
|
||||||
|
{% elif item.status == 'archived' %}bg-surface-100 dark:bg-surface-700 text-surface-600 dark:text-surface-400
|
||||||
|
{% else %}bg-surface-100 dark:bg-surface-700 text-surface-600 dark:text-surface-400{% endif %}">
|
||||||
|
{{ item.status }}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if item.startDate %}
|
||||||
|
<p class="text-xs text-surface-500 mb-1">
|
||||||
|
{{ item.startDate }}{% if item.endDate %} – {{ item.endDate }}{% else %} – Present{% endif %}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if item.description %}
|
||||||
|
<p class="text-sm text-surface-600 dark:text-surface-400 mb-2">{{ item.description }}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if showTechnologies and item.technologies and item.technologies.length %}
|
||||||
|
<div class="flex flex-wrap gap-1">
|
||||||
|
{% for tech in item.technologies %}
|
||||||
|
<span class="text-xs px-2 py-0.5 bg-surface-100 dark:bg-surface-700 text-surface-600 dark:text-surface-400 rounded">
|
||||||
|
{{ tech }}
|
||||||
|
</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
||||||
70
_includes/components/sections/cv-projects-work.njk
Normal file
70
_includes/components/sections/cv-projects-work.njk
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
{#
|
||||||
|
CV Work Projects Section - filters projects by projectType == "work"
|
||||||
|
Data fetched from /cv/data.json via homepage plugin
|
||||||
|
#}
|
||||||
|
|
||||||
|
{% set sectionConfig = section.config or {} %}
|
||||||
|
{% set maxItems = sectionConfig.maxItems or 10 %}
|
||||||
|
{% set showTechnologies = sectionConfig.showTechnologies if sectionConfig.showTechnologies is defined else true %}
|
||||||
|
|
||||||
|
{% set workProjects = [] %}
|
||||||
|
{% if cv and cv.projects %}
|
||||||
|
{% for item in cv.projects %}
|
||||||
|
{% if item.projectType == "work" %}
|
||||||
|
{% set workProjects = (workProjects.push(item), workProjects) %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if workProjects.length %}
|
||||||
|
<section class="mb-8 sm:mb-12" id="work-projects">
|
||||||
|
<h2 class="text-xl sm:text-2xl font-bold text-surface-900 dark:text-surface-100 mb-4 sm:mb-6">
|
||||||
|
{{ sectionConfig.title or "Work Projects" }}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||||
|
{% for item in workProjects | head(maxItems) %}
|
||||||
|
<div class="p-4 bg-white dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 hover:border-primary-400 dark:hover:border-primary-600 transition-colors">
|
||||||
|
<div class="flex items-start justify-between gap-2 mb-1">
|
||||||
|
<h3 class="font-semibold text-surface-900 dark:text-surface-100">
|
||||||
|
{% if item.url %}
|
||||||
|
<a href="{{ item.url }}" class="hover:text-primary-600 dark:hover:text-primary-400">{{ item.name }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ item.name }}
|
||||||
|
{% endif %}
|
||||||
|
</h3>
|
||||||
|
{% if item.status %}
|
||||||
|
<span class="shrink-0 text-xs px-2 py-0.5 rounded-full capitalize
|
||||||
|
{% if item.status == 'active' %}bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300
|
||||||
|
{% elif item.status == 'maintained' %}bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300
|
||||||
|
{% elif item.status == 'archived' %}bg-surface-100 dark:bg-surface-700 text-surface-600 dark:text-surface-400
|
||||||
|
{% else %}bg-surface-100 dark:bg-surface-700 text-surface-600 dark:text-surface-400{% endif %}">
|
||||||
|
{{ item.status }}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if item.startDate %}
|
||||||
|
<p class="text-xs text-surface-500 mb-1">
|
||||||
|
{{ item.startDate }}{% if item.endDate %} – {{ item.endDate }}{% else %} – Present{% endif %}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if item.description %}
|
||||||
|
<p class="text-sm text-surface-600 dark:text-surface-400 mb-2">{{ item.description }}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if showTechnologies and item.technologies and item.technologies.length %}
|
||||||
|
<div class="flex flex-wrap gap-1">
|
||||||
|
{% for tech in item.technologies %}
|
||||||
|
<span class="text-xs px-2 py-0.5 bg-surface-100 dark:bg-surface-700 text-surface-600 dark:text-surface-400 rounded">
|
||||||
|
{{ tech }}
|
||||||
|
</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
||||||
6
cv.njk
6
cv.njk
@@ -61,9 +61,9 @@ pagefindIgnore: true
|
|||||||
{% set section = { type: "cv-skills", config: {} } %}
|
{% set section = { type: "cv-skills", config: {} } %}
|
||||||
{% include "components/sections/cv-skills.njk" ignore missing %}
|
{% include "components/sections/cv-skills.njk" ignore missing %}
|
||||||
|
|
||||||
{# Projects #}
|
{# Work Projects (only work-related projects on the CV page) #}
|
||||||
{% set section = { type: "cv-projects", config: {} } %}
|
{% set section = { type: "cv-projects-work", config: {} } %}
|
||||||
{% include "components/sections/cv-projects.njk" ignore missing %}
|
{% include "components/sections/cv-projects-work.njk" ignore missing %}
|
||||||
|
|
||||||
{# Education & Languages #}
|
{# Education & Languages #}
|
||||||
{% set section = { type: "cv-education", config: {} } %}
|
{% set section = { type: "cv-education", config: {} } %}
|
||||||
|
|||||||
Reference in New Issue
Block a user