-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
36 lines (33 loc) · 950 Bytes
/
.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
const cacheBuster = require('@mightyplow/eleventy-plugin-cache-buster');
const fs = require("fs");
module.exports = function(eleventyConfig){
const cacheBusterOptions = {
createResourceHash(outputDirectoy, url, target) {
return Date.now();
}
};
eleventyConfig.addPlugin(cacheBuster(cacheBusterOptions))
eleventyConfig.addPassthroughCopy("assets")
eleventyConfig.setBrowserSyncConfig({
callbacks: {
ready: function(err, bs) {
const content_404 = fs.readFileSync('_site/404.html');
bs.addMiddleware("*", (req, res) => {
// Provides the 404 content without redirect.
res.write(content_404);
res.end();
});
}
}
});
return {
passthroughFileCopy: true,
markdownTemplateEngine: 'njk',
templateFormats: ['html', 'njk', 'md'],
dir: {
input: "src",
output: "_site",
includes: "includes"
}
}
}