ese-website/eleventy.config.js

30 lines
778 B
JavaScript
Raw Normal View History

2024-09-14 10:59:22 +02:00
const { EleventyHtmlBasePlugin, EleventyI18nPlugin } = require("@11ty/eleventy");
2024-09-13 17:18:41 +02:00
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
2024-09-12 13:41:52 +02:00
// update this :)
const year = 2024;
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
2024-09-13 17:18:41 +02:00
eleventyConfig.addPlugin(eleventyNavigationPlugin);
2024-09-14 10:59:22 +02:00
eleventyConfig.addPlugin(EleventyI18nPlugin, {
defaultLanguage: "de",
});
2024-09-12 13:41:52 +02:00
eleventyConfig.addGlobalData("year", year);
2024-09-14 10:59:22 +02:00
eleventyConfig.addFilter("pageLang", function(value) {
return value.filter(item => item.page.lang === this.page.lang)
});
2024-09-12 13:41:52 +02:00
return {
dir: {
input: "content",
2024-09-13 17:04:16 +02:00
includes: "../_includes",
layouts: "../_layouts",
data: "../_data",
2024-09-12 13:41:52 +02:00
},
pathPrefix: `/${year}/`,
}
};