-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eleventy.js
38 lines (34 loc) · 1.07 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
module.exports = function (config) {
// Layouts
config.addLayoutAlias('base', 'base.njk')
// Copy CSS and whatnot
config.addPassthroughCopy("src/static")
config.addPassthroughCopy({"src/public": "/"})
// Add stats filters
config.addFilter("count", function(collection) {
return collection.length
})
config.addFilter("combinations", function(collection) {
return collection.length * (collection.length - 1)
})
config.addFilter("quote", function(collection) {
return collection.map(w => `"${w}"`)
})
// Add sorting
config.addFilter("sortedByPriority", function(collection) {
return collection.sort((a, b) => a["data"]["priority"] - b["data"]["priority"])
})
return {
dir: {
input: 'src',
output: 'dist',
includes: 'includes',
layouts: 'layouts',
data: 'data'
},
templateFormats: ['njk', 'md'],
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
passthroughFileCopy: true
}
}