samuel-philipp.de/.eleventy.js

49 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2023-01-10 17:59:35 +00:00
const pluginRev = require("eleventy-plugin-rev");
2023-01-10 16:34:27 +00:00
const eleventySass = require("eleventy-sass");
const tinyHTML = require('@sardine/eleventy-plugin-tinyhtml');
const site = require('./src/_data/site.js');
module.exports = function (eleventyConfig) {
2023-01-10 17:59:35 +00:00
eleventyConfig.addPlugin(pluginRev);
2023-01-10 16:34:27 +00:00
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";
};
}
2023-01-10 17:59:35 +00:00
},
rev: true
2023-01-10 16:34:27 +00:00
});
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.addPassthroughCopy({
2023-05-10 18:46:28 +00:00
"src/js": "js",
2023-01-10 16:34:27 +00:00
"src/img": "img",
"src/font": "font",
"src/favicon.*": "",
2023-01-10 23:43:32 +00:00
"node_modules/flag-icons/flags": "flags",
2023-01-10 16:34:27 +00:00
});
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}/`
}
};
};