feat: add filtered section templates for work/personal type distinction
Add thin-wrapper templates for work/personal filtering of CV sections:
- 8 new templates: cv-{experience,education,skills,interests}-{personal,work}.njk
- cv-languages.njk: standalone languages section (split from education)
- homepage-section.njk: 9 new routes for filtered variants
- cv.njk: uses work-only variants for the /cv/ page
- Base templates: filterType support in experience, education, skills, interests
- _data/cv.js: skillTypes and interestTypes fallback fields
This commit is contained in:
@@ -27,9 +27,11 @@ export default function () {
|
||||
experience: [],
|
||||
projects: [],
|
||||
skills: {},
|
||||
skillTypes: {},
|
||||
languages: [],
|
||||
education: [],
|
||||
interests: [],
|
||||
interestTypes: {},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,24 @@
|
||||
{% include "components/sections/cv-education.njk" ignore missing %}
|
||||
{% elif section.type == "cv-interests" %}
|
||||
{% include "components/sections/cv-interests.njk" ignore missing %}
|
||||
{% elif section.type == "cv-experience-personal" %}
|
||||
{% include "components/sections/cv-experience-personal.njk" ignore missing %}
|
||||
{% elif section.type == "cv-experience-work" %}
|
||||
{% include "components/sections/cv-experience-work.njk" ignore missing %}
|
||||
{% elif section.type == "cv-education-personal" %}
|
||||
{% include "components/sections/cv-education-personal.njk" ignore missing %}
|
||||
{% elif section.type == "cv-education-work" %}
|
||||
{% include "components/sections/cv-education-work.njk" ignore missing %}
|
||||
{% elif section.type == "cv-skills-personal" %}
|
||||
{% include "components/sections/cv-skills-personal.njk" ignore missing %}
|
||||
{% elif section.type == "cv-skills-work" %}
|
||||
{% include "components/sections/cv-skills-work.njk" ignore missing %}
|
||||
{% elif section.type == "cv-interests-personal" %}
|
||||
{% include "components/sections/cv-interests-personal.njk" ignore missing %}
|
||||
{% elif section.type == "cv-interests-work" %}
|
||||
{% include "components/sections/cv-interests-work.njk" ignore missing %}
|
||||
{% elif section.type == "cv-languages" %}
|
||||
{% include "components/sections/cv-languages.njk" ignore missing %}
|
||||
{% elif section.type == "blogroll" %}
|
||||
{% include "components/sections/blogroll.njk" ignore missing %}
|
||||
{% elif section.type == "podroll" %}
|
||||
|
||||
2
_includes/components/sections/cv-education-personal.njk
Normal file
2
_includes/components/sections/cv-education-personal.njk
Normal file
@@ -0,0 +1,2 @@
|
||||
{% set filterType = "personal" %}
|
||||
{% include "components/sections/cv-education.njk" %}
|
||||
2
_includes/components/sections/cv-education-work.njk
Normal file
2
_includes/components/sections/cv-education-work.njk
Normal file
@@ -0,0 +1,2 @@
|
||||
{% set filterType = "work" %}
|
||||
{% include "components/sections/cv-education.njk" %}
|
||||
@@ -15,6 +15,7 @@
|
||||
{% if hasEducation %}
|
||||
<div class="space-y-3 mb-6">
|
||||
{% for item in cv.education %}
|
||||
{% if not filterType or item.educationType == filterType or (filterType == "personal" and not item.educationType) %}
|
||||
<div class="p-4 bg-white dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700">
|
||||
<h3 class="font-semibold text-surface-900 dark:text-surface-100">{{ item.degree }}</h3>
|
||||
<p class="text-sm text-surface-600 dark:text-surface-400">
|
||||
@@ -25,11 +26,12 @@
|
||||
<p class="text-sm text-surface-700 dark:text-surface-300 mt-1">{{ item.description }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if hasLanguages %}
|
||||
{% if hasLanguages and not filterType %}
|
||||
<div class="flex flex-wrap gap-3">
|
||||
{% for lang in cv.languages %}
|
||||
<div class="flex items-center gap-2 px-3 py-1.5 bg-white dark:bg-surface-800 rounded-full border border-surface-200 dark:border-surface-700">
|
||||
|
||||
2
_includes/components/sections/cv-experience-personal.njk
Normal file
2
_includes/components/sections/cv-experience-personal.njk
Normal file
@@ -0,0 +1,2 @@
|
||||
{% set filterType = "personal" %}
|
||||
{% include "components/sections/cv-experience.njk" %}
|
||||
2
_includes/components/sections/cv-experience-work.njk
Normal file
2
_includes/components/sections/cv-experience-work.njk
Normal file
@@ -0,0 +1,2 @@
|
||||
{% set filterType = "work" %}
|
||||
{% include "components/sections/cv-experience.njk" %}
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
<div class="space-y-4">
|
||||
{% for item in cv.experience | head(maxItems) %}
|
||||
{% if not filterType or item.experienceType == filterType or (filterType == "personal" and not item.experienceType) %}
|
||||
<div class="relative pl-6 border-l-2 border-primary-300 dark:border-primary-700">
|
||||
<div class="absolute -left-[7px] top-1 w-3 h-3 rounded-full bg-primary-500"></div>
|
||||
<h3 class="font-semibold text-surface-900 dark:text-surface-100">{{ item.title }}</h3>
|
||||
@@ -40,6 +41,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
2
_includes/components/sections/cv-interests-personal.njk
Normal file
2
_includes/components/sections/cv-interests-personal.njk
Normal file
@@ -0,0 +1,2 @@
|
||||
{% set filterType = "personal" %}
|
||||
{% include "components/sections/cv-interests.njk" %}
|
||||
2
_includes/components/sections/cv-interests-work.njk
Normal file
2
_includes/components/sections/cv-interests-work.njk
Normal file
@@ -0,0 +1,2 @@
|
||||
{% set filterType = "work" %}
|
||||
{% include "components/sections/cv-interests.njk" %}
|
||||
@@ -11,9 +11,11 @@
|
||||
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for interest in cv.interests %}
|
||||
{% if not filterType or (cv.interestTypes and cv.interestTypes[interest] == filterType) or (filterType == "personal" and (not cv.interestTypes or not cv.interestTypes[interest])) %}
|
||||
<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>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
21
_includes/components/sections/cv-languages.njk
Normal file
21
_includes/components/sections/cv-languages.njk
Normal file
@@ -0,0 +1,21 @@
|
||||
{#
|
||||
CV Languages Section
|
||||
Data fetched from /cv/data.json via homepage plugin
|
||||
#}
|
||||
|
||||
{% if cv and cv.languages and cv.languages.length %}
|
||||
<section class="mb-8 sm:mb-12" id="languages">
|
||||
<h2 class="text-xl sm:text-2xl font-bold text-surface-900 dark:text-surface-100 mb-4 sm:mb-6">
|
||||
{{ section.config.title or "Languages" }}
|
||||
</h2>
|
||||
|
||||
<div class="flex flex-wrap gap-3">
|
||||
{% for lang in cv.languages %}
|
||||
<div class="flex items-center gap-2 px-3 py-1.5 bg-white dark:bg-surface-800 rounded-full border border-surface-200 dark:border-surface-700">
|
||||
<span class="font-medium text-sm text-surface-900 dark:text-surface-100">{{ lang.name }}</span>
|
||||
<span class="text-xs text-surface-500 capitalize">{{ lang.level }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
2
_includes/components/sections/cv-skills-personal.njk
Normal file
2
_includes/components/sections/cv-skills-personal.njk
Normal file
@@ -0,0 +1,2 @@
|
||||
{% set filterType = "personal" %}
|
||||
{% include "components/sections/cv-skills.njk" %}
|
||||
2
_includes/components/sections/cv-skills-work.njk
Normal file
2
_includes/components/sections/cv-skills-work.njk
Normal file
@@ -0,0 +1,2 @@
|
||||
{% set filterType = "work" %}
|
||||
{% include "components/sections/cv-skills.njk" %}
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
{% for category, items in cv.skills | dictsort %}
|
||||
{% if not filterType or (cv.skillTypes and cv.skillTypes[category] == filterType) or (filterType == "personal" and (not cv.skillTypes or not cv.skillTypes[category])) %}
|
||||
<div class="p-4 bg-white dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700">
|
||||
<h3 class="font-semibold text-sm uppercase tracking-wide text-surface-600 dark:text-surface-400 mb-2">
|
||||
{{ category }}
|
||||
@@ -23,6 +24,7 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
28
cv.njk
28
cv.njk
@@ -53,25 +53,29 @@ pagefindIgnore: true
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{# Experience — reuse the section partial #}
|
||||
{% set section = { type: "cv-experience", config: {} } %}
|
||||
{% include "components/sections/cv-experience.njk" ignore missing %}
|
||||
{# Experience — work-only variant #}
|
||||
{% set section = { type: "cv-experience-work", config: {} } %}
|
||||
{% include "components/sections/cv-experience-work.njk" ignore missing %}
|
||||
|
||||
{# Skills #}
|
||||
{% set section = { type: "cv-skills", config: {} } %}
|
||||
{% include "components/sections/cv-skills.njk" ignore missing %}
|
||||
{# Skills — work-only variant #}
|
||||
{% set section = { type: "cv-skills-work", config: {} } %}
|
||||
{% include "components/sections/cv-skills-work.njk" ignore missing %}
|
||||
|
||||
{# Work Projects (only work-related projects on the CV page) #}
|
||||
{% set section = { type: "cv-projects-work", config: {} } %}
|
||||
{% include "components/sections/cv-projects-work.njk" ignore missing %}
|
||||
|
||||
{# Education & Languages #}
|
||||
{% set section = { type: "cv-education", config: {} } %}
|
||||
{% include "components/sections/cv-education.njk" ignore missing %}
|
||||
{# Education — work-only variant #}
|
||||
{% set section = { type: "cv-education-work", config: {} } %}
|
||||
{% include "components/sections/cv-education-work.njk" ignore missing %}
|
||||
|
||||
{# Interests #}
|
||||
{% set section = { type: "cv-interests", config: {} } %}
|
||||
{% include "components/sections/cv-interests.njk" ignore missing %}
|
||||
{# Languages — standalone section #}
|
||||
{% set section = { type: "cv-languages", config: {} } %}
|
||||
{% include "components/sections/cv-languages.njk" ignore missing %}
|
||||
|
||||
{# Interests — work-only variant #}
|
||||
{% set section = { type: "cv-interests-work", config: {} } %}
|
||||
{% include "components/sections/cv-interests-work.njk" ignore missing %}
|
||||
|
||||
{# Last Updated #}
|
||||
{% if cv.lastUpdated %}
|
||||
|
||||
Reference in New Issue
Block a user