generated from adamstddrd/grease
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eleventy.js
49 lines (42 loc) · 1.37 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
48
49
// docs: https://www.11ty.io/docs/config/
// Import filters
const sortByOrder = require('./_source/_filters/sortByOrder.js');
const slayWidows = require('./_source/_filters/slayWidows.js');
const prettyDate = require('./_source/_filters/prettyDate.js');
module.exports = function(eleventyConfig) {
// filters
eleventyConfig.addFilter('sortByOrder', sortByOrder);
eleventyConfig.addFilter('slayWidows', slayWidows);
eleventyConfig.addFilter('prettyDate', prettyDate);
// BrowserSync settings
eleventyConfig.setBrowserSyncConfig({
files: [ // watch the files generated by Gulp
'_public/assets/*.css',
'_public/assets/*.js',
'_public/assets',
'!_public/assets/**/**.map'
],
ui: false,
});
// MarkdownIt settings
let markdownIt = require('markdown-it');
let markdownItOptions = {
html: true, // allow HTML markup
typographer: true // fancy quotes
};
// 11ty settings
eleventyConfig.setLibrary('md', markdownIt(markdownItOptions));
eleventyConfig.addPassthroughCopy('_redirects');
eleventyConfig.addPassthroughCopy({ '_source/_assets/fonts': 'assets/fonts' });
eleventyConfig.setDataDeepMerge(true);
return {
dir: {
input: '_source',
output: '_public',
layouts: '_layouts',
includes: '_includes'
},
templateFormats: ['html', 'md', 'liquid'],
htmlTemplateEngine: 'liquid'
};
};