-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
26 lines (23 loc) · 1.02 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
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy('./src/pin.svg');
eleventyConfig.addPassthroughCopy('./src/app/app.css');
eleventyConfig.addPassthroughCopy('./src/app/app.js');
eleventyConfig.addPassthroughCopy('./src/fonts');
eleventyConfig.addPassthroughCopy({ './src/_data/categories.json': 'desktop/categories.json' });
eleventyConfig.addPassthroughCopy({ './src/_data/entries.json': 'desktop/entries.json' });
eleventyConfig.addPassthroughCopy({ './src/_data/statistics.json': 'desktop/statistics.json' });
eleventyConfig.addNunjucksFilter("filterByCategorie", function(entries, mainCat, subCat = null) {
const cat = [mainCat, subCat].filter(Boolean).join('.');
return entries.filter(entry => {
return entry.categories.reduce((includes, value) =>
includes || value.startsWith(cat)
, false);
});
});
return {
dir: {
input: 'src',
output: 'results'
}
};
}