feat: add configurable CV page layout with builder support

CV page now reads layout config from cv-page.json when available,
supporting single-column, two-column, and full-width hero layouts with
configurable sections, sidebar widgets, and footer columns. Falls back
to the previous hardcoded layout when no config exists.
This commit is contained in:
Ricardo
2026-02-20 15:17:32 +01:00
parent a54600b003
commit 66e55af7ee
5 changed files with 291 additions and 61 deletions

29
_data/cvPageConfig.js Normal file
View File

@@ -0,0 +1,29 @@
/**
* CV Page Configuration Data
* Reads config from indiekit-endpoint-cv plugin CV page builder.
* Falls back to null — cv.njk then uses the default hardcoded layout.
*
* The CV plugin writes a .indiekit/cv-page.json file that Eleventy watches.
* On change, a rebuild picks up the new config, allowing layout changes
* without a Docker rebuild.
*/
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 {
// Resolve via the content/ symlink relative to the Eleventy project
const configPath = resolve(__dirname, "..", "content", ".indiekit", "cv-page.json");
const raw = readFileSync(configPath, "utf8");
const config = JSON.parse(raw);
console.log("[cvPageConfig] Loaded CV page builder config");
return config;
} catch {
// No CV page builder config — fall back to hardcoded layout in cv.njk
return null;
}
}