samuel-philipp.de/.eleventy.js
Samuel Philipp 051deb6f27
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
more improvements and cleanup
2023-05-10 20:46:28 +02:00

48 lines
1.4 KiB
JavaScript

const pluginRev = require("eleventy-plugin-rev");
const eleventySass = require("eleventy-sass");
const tinyHTML = require('@sardine/eleventy-plugin-tinyhtml');
const site = require('./src/_data/site.js');
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(pluginRev);
eleventyConfig.addPlugin(tinyHTML);
eleventyConfig.addPlugin(eleventySass, {
sass: {
loadPaths: ["node_modules"],
style: "compressed",
sourceMap: false,
},
compileOptions: {
permalink: function (contents, inputPath) {
return (data) => {
return data.page.filePathStem.replace(/^\/scss\//, "/css/") + ".css";
};
}
},
rev: true
});
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.addPassthroughCopy({
"src/js": "js",
"src/img": "img",
"src/font": "font",
"src/favicon.*": "",
"node_modules/flag-icons/flags": "flags",
});
return {
// Pre-process *.html files with: (default: `liquid`)
htmlTemplateEngine: "njk",
// Opt-out of pre-processing global data JSON files: (default: `liquid`)
dataTemplateEngine: "njk",
dir: {
input: "src",
// includes: "_includes",
// layouts: "_includes/layouts",
data: "_data",
output: `dist/${site.lang}/`
}
};
};