-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eleventy.js
65 lines (55 loc) · 1.97 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const filters = require('./_11ty/filters.js');
const collections = require('./_11ty/collections.js');
const transforms = require('./_11ty/transforms.js');
const pluginRss = require('@11ty/eleventy-plugin-rss');
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
var escape = require('escape-html');
const cssBrowserSupport = require("@11tyrocks/eleventy-plugin-css-browser-support");
module.exports = function (eleventyConfig) {
// Filters
Object.keys(filters).forEach((filterName) => {
eleventyConfig.addFilter(filterName, filters[filterName]);
});
// Collections
Object.keys(collections).forEach((collectionName) => {
eleventyConfig.addCollection(collectionName, collections[collectionName]);
});
// Transforms
Object.keys(transforms).forEach((transformName) => {
eleventyConfig.addTransform(transformName, transforms[transformName]);
});
eleventyConfig.addPairedShortcode('escape', function (content) {
return escape(content);
});
// Plugins
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPlugin(cssBrowserSupport, {
includePanelJS: false,
browserList: ["chrome", "firefox", "safari", "safari_ios", "chrome_android"],
});
eleventyConfig.addPassthroughCopy('./src/static/img');
eleventyConfig.addPassthroughCopy('./src/static/min');
eleventyConfig.addPassthroughCopy('./src/images');
eleventyConfig.addPassthroughCopy('./src/slidedecks');
eleventyConfig.addPassthroughCopy('admin');
eleventyConfig.addPassthroughCopy('_redirects');
eleventyConfig.addPassthroughCopy({
'./src/static/favicon': '/',
'./src/static/css': '/assets',
});
return {
templateFormats: ['md', 'njk'],
pathPrefix: '/',
markdownTemplateEngine: 'liquid',
htmlTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
passthroughFileCopy: true,
dir: {
input: 'src',
includes: '_includes',
data: '_data',
output: '_site',
},
};
};