-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
47 lines (40 loc) · 1.23 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
40
41
42
43
44
45
46
47
const fs = require('fs');
const rssPlugin = require('@11ty/eleventy-plugin-rss');
module.exports = function(config) {
config.addPassthroughCopy('src/imgs');
config.addPassthroughCopy('src/media');
config.addPassthroughCopy('src/css');
config.addPassthroughCopy('src/js');
//removed until domain created
//config.addPassthroughCopy('CNAME');
config.addPlugin(rssPlugin);
config.addCollection('playbooks', collection => {
return [
...collection.getFilteredByGlob('./src/playbooks/*.md').sort((a, b) => {
if (a.data.title > b.data.title) return -1;
else if (a.data.title < b.data.title) return 1;
else return 0;
})
]
});
// 404
config.setBrowserSyncConfig({
callbacks: {
ready: function(err, browserSync) {
const content_404 = fs.readFileSync('dist/404.html');
browserSync.addMiddleware('*', (req, res) => {
// Provides the 404 content without redirect.
res.write(content_404);
res.end();
});
}
}
});
return {
dir: {
input: 'src',
output: 'dist'
},
passthroughFileCopy: true
};
}