-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eleventy.js
46 lines (38 loc) · 1.29 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
const rssPlugin = require('@11ty/eleventy-plugin-rss');
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
// Filters
const dateFilter = require('./src/filters/date-filter.js');
const w3DateFilter = require('./src/filters/w3-date-filter.js');
module.exports = config => {
// Add filters
config.addFilter('dateFilter', dateFilter);
config.addFilter('w3DateFilter', w3DateFilter);
config.addFilter("debugger", (...args) => {
console.log(...args)
debugger;
});
// Plugins
config.addPlugin(rssPlugin);
config.addPlugin(syntaxHighlight);
// Put robots.txt in root
config.addPassthroughCopy({ './src/robots.txt': '/robots.txt' });
// Set directories to pass through to the dist folder
config.addPassthroughCopy('./src/img/');
config.addPassthroughCopy('./src/css/');
config.addPassthroughCopy('./src/font/');
// Returns post items, sorted by issue order
config.addCollection('posts', collection => {
return [...collection.getFilteredByGlob('./src/posts/*.md')];
});
// Tell 11ty to use the .eleventyignore and ignore our .gitignore file
config.setUseGitIgnore(false);
return {
markdownTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dir: {
input: 'src',
output: 'dist'
}
};
};