Files
blog-eleventy-indiekit/_includes/components/sections/cv-skills.njk
Ricardo cd7083eb9a feat: preserve custom order for skills and interests sections
Remove dictsort from for-loops so categories render in the order
set by the admin UI drag-drop reorder, instead of alphabetically.
2026-02-25 15:57:42 +01:00

32 lines
1.2 KiB
Plaintext

{#
CV Skills Section - skills grouped by category
Data fetched from /cv/data.json via homepage plugin
#}
{% if cv and cv.skills and (cv.skills | dictsort | length) %}
<section class="mb-8 sm:mb-12" id="skills">
<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 "Skills" }}
</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
{% for category, items in cv.skills %}
{% if not filterType or (cv.skillTypes and cv.skillTypes[category] == filterType) or 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 }}
</h3>
<div class="flex flex-wrap gap-1.5">
{% for skill in items %}
<span class="text-xs px-2 py-1 bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 rounded-full">
{{ skill }}
</span>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
</div>
</section>
{% endif %}