ese-website/eleventy.config.js

52 lines
1.5 KiB
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-15 13:18:05 +02:00
const bundlerPlugin = require("@11ty/eleventy-plugin-bundle");
2024-09-14 12:44:27 +02:00
const fs = require('fs');
2024-09-12 13:41:52 +02:00
// update this :)
const year = 2024;
2024-09-20 14:46:23 +02:00
const eseColor = "#F221B7";
2024-09-12 13:41:52 +02:00
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-15 13:18:05 +02:00
eleventyConfig.addPlugin(bundlerPlugin);
2024-09-12 13:41:52 +02:00
eleventyConfig.addGlobalData("year", year);
2024-09-20 14:46:23 +02:00
eleventyConfig.addGlobalData("eseColor", eseColor);
2024-09-12 13:41:52 +02:00
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-20 14:46:23 +02:00
// copy aileron font
eleventyConfig.addPassthroughCopy({'./submodules/aileron/fonts/*.(ttf|woff|woff2)': 'fonts'})
eleventyConfig.addPassthroughCopy({'./submodules/aileron/aileron.lite.min.css': 'aileron.lite.min.css'})
2024-09-20 18:39:35 +02:00
// copy static files
eleventyConfig.addPassthroughCopy('./static')
2024-09-15 17:23:25 +02:00
2024-09-14 12:44:27 +02:00
// copy german start page to root url
eleventyConfig.on(
"eleventy.after",
async ({ dir, runMode, outputMode }) => {
if (outputMode === "fs") {
fs.copyFile(`${dir.output}/de/index.html`, `${dir.output}/index.html`, (err) => {
if (err) console.log(err);
});
}
}
);
2024-09-12 13:41:52 +02:00
return {
dir: {
input: "content",
2024-09-13 17:04:16 +02:00
includes: "../_includes",
data: "../_data",
2024-09-12 13:41:52 +02:00
},
pathPrefix: `/${year}/`,
}
};