From 61eb072cf478b1749b2ed6fce163add81dfff84e Mon Sep 17 00:00:00 2001 From: Elis Eriksson Date: Tue, 7 Jul 2026 16:53:36 +0200 Subject: bro i REALLY gotta learn how to do micro commits --- eleventy.config.mjs | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'eleventy.config.mjs') diff --git a/eleventy.config.mjs b/eleventy.config.mjs index 58fad4e..0ed461a 100644 --- a/eleventy.config.mjs +++ b/eleventy.config.mjs @@ -77,16 +77,34 @@ export default function(eleventyConfig) { }, }); - eleventyConfig.addPlugin(eleventyImageTransformPlugin, { - widths: [200, "auto"], - htmlOptions: { - imgAttributes: { - loading: "lazy", - decoding: "async", - }, - pictureAttributes: {} - }, - }); + eleventyConfig.addGlobalData("age", () => { + const birthday = new Date("2010-05-11"); + + const today = new Date(); + + let age = today.getFullYear() - birthday.getFullYear(); + + if ( + today.getMonth() < birthday.getMonth() || + (today.getMonth() === birthday.getMonth() && + today.getDate() < birthday.getDate()) + ) { + age--; + } + + return age; + }); + + // eleventyConfig.addPlugin(eleventyImageTransformPlugin, { + // widths: [200, "auto"], + // htmlOptions: { + // imgAttributes: { + // loading: "lazy", + // decoding: "async", + // }, + // pictureAttributes: {} + // }, + // }); eleventyConfig.addBundle("css", { toFileDirectory: "assets/css/bundles/", -- cgit v1.3-7-ge9ab