-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.eleventy.js
More file actions
44 lines (37 loc) · 1.13 KB
/
.eleventy.js
File metadata and controls
44 lines (37 loc) · 1.13 KB
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
39
40
41
42
43
44
const util = require("util");
module.exports = function(eleventyConfig) {
// a debug utility
eleventyConfig.addFilter("dump", obj => {
return util.inspect(obj);
});
// alias
eleventyConfig.addLayoutAlias("default", "layouts/base.njk");
// compress and combine js files
eleventyConfig.addFilter("jsmin", require("./src/utils/minify-js.js"));
// minify the html output when running in prod
if (process.env.NODE_ENV == "production") {
eleventyConfig.addTransform(
"htmlmin",
require("./src/utils/minify-html.js")
);
}
// Collections
eleventyConfig.addCollection("processes", function(collection) {
return collection.getFilteredByGlob("./src/site/content/*.md");
});
// Passthrough
// eleventyConfig.addPassthroughCopy("./src/site/fonts");
eleventyConfig.addPassthroughCopy("./src/site/images");
eleventyConfig.addPassthroughCopy("./src/site/css");
return {
dir: {
input: "src/site",
inludes: "_includes",
output: "dist"
},
passthroughFileCopy: true,
templateFormats: ["njk", "md"],
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk"
};
};