From 0bf147512bb84d1a05d4c7cf1ec049c7a6b534d5 Mon Sep 17 00:00:00 2001 From: Shipwreckt Date: Sun, 2 Nov 2025 20:32:56 +0000 Subject: Some small tweaks with header --- .eleventy.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .eleventy.js (limited to '.eleventy.js') diff --git a/.eleventy.js b/.eleventy.js new file mode 100644 index 0000000..4bcf389 --- /dev/null +++ b/.eleventy.js @@ -0,0 +1,32 @@ +import { DateTime } from "luxon"; + +export default function(eleventyConfig) { + // Posts collection + eleventyConfig.addCollection("posts", collectionApi => { + return collectionApi + .getFilteredByGlob("./src/posts/*.{md,html}") + .sort((a, b) => b.date - a.date); + }); + + // Date formatting filter + eleventyConfig.addFilter("dateFormat", (dateObj, format = "MMMM dd, yyyy") => { + if (!dateObj) return ""; + return DateTime.fromJSDate(dateObj).toFormat(format); + }); + + // Passthrough for static assets + eleventyConfig.addPassthroughCopy("src/images"); + eleventyConfig.addPassthroughCopy("src/assets"); + + // Directory configuration + return { + htmlTemplateEngine: "njk", + markdownTemplateEngine: "njk", + dir: { + input: "src", + output: "public", + includes: "_includes" + } + }; +} + -- cgit v1.2.3