-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
39 lines (31 loc) · 1.12 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
39
const CleanCSS = require("clean-css");
module.exports = function (eleventyConfig) {
// Add a date formatter filter to Nunjucks
eleventyConfig.addFilter("dateDisplay", require("./filters/dates.js"));
eleventyConfig.addFilter("timestamp", require("./filters/timestamp.js"));
eleventyConfig.addFilter("squash", require("./filters/squash.js"));
eleventyConfig.addPassthroughCopy('css');
// Minify CSS
eleventyConfig.addFilter("cssmin", function (code) {
return new CleanCSS({}).minify(code).styles;
});
eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);
eleventyConfig.addCollection('experiments', function (collection) {
return collection.getAllSorted().reverse().filter(function (item) {
if ('status' in item.data == true) {
return item.data
}
});
});
return {
dir: {
input: "src/site",
output: "dist",
includes: "_includes"
},
templateFormats: ["njk", "md", "png", "ico", "pdf", "css", "js", "wav", "mp3", "gltf", "glb"],
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk",
passthroughFileCopy: true
};
};