Files
indiekit-blog/_data/cv.js
Ricardo 3bf0e78f74 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
2026-02-20 13:11:37 +01:00

38 lines
997 B
JavaScript

/**
* CV Data — reads from indiekit-endpoint-cv plugin data file.
*
* The CV plugin writes content/.indiekit/cv.json on every save
* and on startup. Eleventy reads that file here.
*
* Falls back to empty defaults if no plugin is installed.
*/
import { readFileSync } from "node:fs";
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
export default function () {
try {
const cvPath = resolve(__dirname, "..", "content", ".indiekit", "cv.json");
const raw = readFileSync(cvPath, "utf8");
const data = JSON.parse(raw);
console.log("[cv] Loaded CV data from plugin");
return data;
} catch {
// No CV plugin data file — return empty defaults
return {
lastUpdated: null,
experience: [],
projects: [],
skills: {},
skillTypes: {},
languages: [],
education: [],
interests: [],
interestTypes: {},
};
}
}