mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
feat: add dedicated /cv page and simplify homepage fallback
Move CV content to a standalone /cv page that reuses the section partials from the homepage builder. Simplify home.njk from a 3-tier to 2-tier fallback (plugin config OR recent posts + explore links). Add /cv to the slash pages navigation dropdown. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
93
cv.njk
Normal file
93
cv.njk
Normal file
@@ -0,0 +1,93 @@
|
||||
---
|
||||
layout: layouts/base.njk
|
||||
withSidebar: false
|
||||
title: CV
|
||||
permalink: /cv/
|
||||
pagefindIgnore: true
|
||||
---
|
||||
|
||||
{# Standalone CV page — renders all CV sections using the same partials as the homepage builder #}
|
||||
|
||||
{% set hasCvData = (cv.experience and cv.experience.length) or
|
||||
(cv.projects and cv.projects.length) or
|
||||
(cv.skills and (cv.skills | dictsort | length)) %}
|
||||
|
||||
{% if hasCvData %}
|
||||
|
||||
{# Hero / intro #}
|
||||
<section class="mb-8 sm:mb-12">
|
||||
<div class="flex flex-col sm:flex-row gap-6 sm:gap-8 items-start">
|
||||
<img
|
||||
src="{{ site.author.avatar }}"
|
||||
alt="{{ site.author.name }}"
|
||||
class="w-24 h-24 sm:w-32 sm:h-32 rounded-full object-cover shadow-lg flex-shrink-0"
|
||||
loading="eager"
|
||||
>
|
||||
<div class="flex-1 min-w-0">
|
||||
<h1 class="text-2xl sm:text-3xl md:text-4xl font-bold text-surface-900 dark:text-surface-100 mb-2">
|
||||
{{ site.author.name }}
|
||||
</h1>
|
||||
{% if site.author.title %}
|
||||
<p class="text-lg sm:text-xl text-primary-600 dark:text-primary-400 mb-3 sm:mb-4">
|
||||
{{ site.author.title }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if site.author.bio %}
|
||||
<p class="text-base sm:text-lg text-surface-700 dark:text-surface-300 mb-4">
|
||||
{{ site.author.bio }}
|
||||
</p>
|
||||
{% endif %}
|
||||
<div class="flex flex-wrap gap-3">
|
||||
{% for link in site.social %}
|
||||
<a
|
||||
href="{{ link.url }}"
|
||||
rel="{{ link.rel }} noopener"
|
||||
class="inline-flex items-center gap-2 px-3 py-2 text-sm bg-surface-100 dark:bg-surface-800 rounded-lg hover:bg-surface-200 dark:hover:bg-surface-700 transition-colors"
|
||||
target="_blank"
|
||||
>
|
||||
<span class="text-sm font-medium">{{ link.name }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{# Experience — reuse the section partial #}
|
||||
{% set section = { type: "cv-experience", config: {} } %}
|
||||
{% include "components/sections/cv-experience.njk" ignore missing %}
|
||||
|
||||
{# Skills #}
|
||||
{% set section = { type: "cv-skills", config: {} } %}
|
||||
{% include "components/sections/cv-skills.njk" ignore missing %}
|
||||
|
||||
{# Projects #}
|
||||
{% set section = { type: "cv-projects", config: {} } %}
|
||||
{% include "components/sections/cv-projects.njk" ignore missing %}
|
||||
|
||||
{# Education & Languages #}
|
||||
{% set section = { type: "cv-education", config: {} } %}
|
||||
{% include "components/sections/cv-education.njk" ignore missing %}
|
||||
|
||||
{# Interests #}
|
||||
{% set section = { type: "cv-interests", config: {} } %}
|
||||
{% include "components/sections/cv-interests.njk" ignore missing %}
|
||||
|
||||
{# Last Updated #}
|
||||
{% if cv.lastUpdated %}
|
||||
<p class="text-sm text-surface-500 text-center mt-8">
|
||||
Last updated: {% if cv.lastUpdated %}{{ cv.lastUpdated | date("PPP") }}{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="text-center py-12">
|
||||
<h1 class="text-2xl font-bold text-surface-900 dark:text-surface-100 mb-4">CV</h1>
|
||||
<p class="text-surface-600 dark:text-surface-400">
|
||||
No CV data available yet. Add your experience, projects, and skills via the
|
||||
<a href="/dashboard" class="text-primary-600 dark:text-primary-400 hover:underline">admin dashboard</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user