-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheleventy.config.js
30 lines (26 loc) · 1.03 KB
/
eleventy.config.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
const { compressHTML } = require('./config/transforms');
const pluginSyntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
const { sortByLevel, sortByOrder, sortCombine } = require('./config/collection-sort');
module.exports = function (config) {
// Tell 11ty to use the .eleventyignore and ignore our .gitignore file
config.setUseGitIgnore(false);
config.addPassthroughCopy('./src/favicon');
config.addWatchTarget('./src/_includes/css');
config.addTransform('compressHTML', compressHTML);
config.addPlugin(pluginSyntaxHighlight);
config.addCollection('sortedEnglish', (collectionApi) => {
return collectionApi.getFilteredByTag('en').sort(sortCombine(sortByLevel, sortByOrder));
});
config.addCollection('sortedGerman', (collectionApi) => {
return collectionApi.getFilteredByTag('de').sort(sortCombine(sortByLevel, sortByOrder));
});
// Return your Object options:
return {
markdownTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dir: {
input: 'src',
output: 'dist',
},
};
};