copy german start page to root url

This commit is contained in:
Lyn Fugmann 2024-09-14 12:44:27 +02:00
parent 9011b604d2
commit c8e5dfa8f0

View file

@ -1,5 +1,6 @@
const { EleventyHtmlBasePlugin, EleventyI18nPlugin } = require("@11ty/eleventy");
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const fs = require('fs');
// update this :)
const year = 2024;
@ -17,6 +18,18 @@ module.exports = function(eleventyConfig) {
return value.filter(item => item.page.lang === this.page.lang)
});
// 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",