2025-01-31 02:18:17 +01:00
|
|
|
import * as sass from "sass";
|
|
|
|
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
2025-01-29 01:42:26 +01:00
|
|
|
import { DateTime } from "luxon";
|
2025-01-28 03:12:25 +01:00
|
|
|
|
|
|
|
export default async function (eleventyConfig) {
|
2025-01-31 02:18:17 +01:00
|
|
|
// Filters
|
2025-01-29 01:42:26 +01:00
|
|
|
eleventyConfig.addFilter("dateLocale", function (value) {
|
|
|
|
return DateTime.fromISO(new Date(value).toISOString()).toLocaleString({
|
|
|
|
year: 'numeric',
|
|
|
|
month: 'short',
|
|
|
|
day: '2-digit',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// SCSS
|
2025-01-28 03:12:25 +01:00
|
|
|
eleventyConfig.addTemplateFormats("scss");
|
|
|
|
|
|
|
|
eleventyConfig.addExtension("scss", {
|
|
|
|
outputFileExtension: "css",
|
|
|
|
compile: async function (inputContent) {
|
|
|
|
let result = sass.compileString(inputContent);
|
|
|
|
|
|
|
|
return async (data) => {
|
|
|
|
return result.css;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
2025-01-31 02:18:17 +01:00
|
|
|
|
|
|
|
//Images
|
|
|
|
eleventyConfig.addPlugin(eleventyImageTransformPlugin);
|
2025-02-11 21:11:06 +01:00
|
|
|
eleventyConfig.addShortcode("figure", (url, alt, caption) => {
|
|
|
|
return `
|
|
|
|
<figure>
|
|
|
|
<img src="${url}" alt="${alt}" />
|
|
|
|
<figcaption>${caption}</figcaption>
|
|
|
|
</figure>
|
|
|
|
`;
|
|
|
|
});
|
2025-02-04 19:38:08 +01:00
|
|
|
|
|
|
|
eleventyConfig.addPassthroughCopy("content/robots.txt");
|
2025-01-28 03:12:25 +01:00
|
|
|
}
|
2025-01-26 23:42:53 +01:00
|
|
|
|
|
|
|
export const config = {
|
|
|
|
dir: {
|
2025-01-27 02:17:27 +01:00
|
|
|
input: "content",
|
2025-01-26 23:42:53 +01:00
|
|
|
includes: "includes",
|
|
|
|
layouts: "layouts",
|
|
|
|
output: "dist"
|
|
|
|
}
|
|
|
|
};
|