61 lines
1.9 KiB
JavaScript
61 lines
1.9 KiB
JavaScript
const { EleventyHtmlBasePlugin, EleventyI18nPlugin } = require("@11ty/eleventy");
|
|
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
|
|
const bundlerPlugin = require("@11ty/eleventy-plugin-bundle");
|
|
const pluginIcons = require('eleventy-plugin-icons');
|
|
const fs = require('fs');
|
|
|
|
// update this :)
|
|
const year = 2024;
|
|
const eseColor = "#F221B7";
|
|
|
|
module.exports = function(eleventyConfig) {
|
|
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
|
|
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
|
eleventyConfig.addPlugin(EleventyI18nPlugin, {
|
|
defaultLanguage: "de",
|
|
});
|
|
eleventyConfig.addPlugin(bundlerPlugin);
|
|
let fontawesomePath = "node_modules/@fortawesome/fontawesome-free/svgs";
|
|
eleventyConfig.addPlugin(pluginIcons, {
|
|
sources: [
|
|
{ name: "regular", path: `${fontawesomePath}/regular`, default: true },
|
|
{ name: "solid", path: `${fontawesomePath}/solid` },
|
|
{ name: "brands", path: `${fontawesomePath}/brands` },
|
|
],
|
|
});
|
|
|
|
eleventyConfig.addGlobalData("year", year);
|
|
eleventyConfig.addGlobalData("eseColor", eseColor);
|
|
|
|
eleventyConfig.addFilter("pageLang", function(value) {
|
|
return value.filter(item => item.page.lang === this.page.lang)
|
|
});
|
|
|
|
// copy aileron font
|
|
eleventyConfig.addPassthroughCopy({'./submodules/aileron/fonts/*.(ttf|woff|woff2)': 'fonts'})
|
|
eleventyConfig.addPassthroughCopy({'./submodules/aileron/aileron.lite.min.css': 'aileron.lite.min.css'})
|
|
// copy static files
|
|
eleventyConfig.addPassthroughCopy('./static')
|
|
|
|
// 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);
|
|
});
|
|
}
|
|
}
|
|
);
|
|
|
|
return {
|
|
dir: {
|
|
input: "content",
|
|
includes: "../_includes",
|
|
data: "../_data",
|
|
},
|
|
pathPrefix: `/${year}/`,
|
|
}
|
|
};
|