-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
38 lines (32 loc) · 1.02 KB
/
.eleventy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const minifyHtmlOutput = (content, outputPath) => {
if(outputPath && outputPath.endsWith('.html') ) {
return require('html-minifier').minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
});
}
return content;
};
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy({
'src/_assets/ico': 'ico',
'src/_assets/img': 'img',
'src/manifest.webmanifest': 'manifest.webmanifest'
});
eleventyConfig.addLayoutAlias('main', 'layouts/main.njk');
eleventyConfig.addPlugin(require('eleventy-plugin-svg-contents'));
eleventyConfig.addTransform('htmlmin', minifyHtmlOutput);
return {
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk",
dataTemplateEngine: "njk",
templateFormats: ["njk"],
dir: {
input: "src",
output: "_site",
includes: "_includes"
},
passthroughFileCopy: true
};
}