-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eleventy.js
50 lines (41 loc) · 1.4 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
module.exports = function (eleventy) {
// Collections
eleventy.addCollection('sitemap', collection => collection.getFilteredByGlob('**/*.md'))
eleventy.addCollection('upcoming-events', collection => collection.getFilteredByTag('event').filter(item => item.date > new Date()))
eleventy.addCollection('past-events', collection => collection.getFilteredByTag('event').filter(item => item.date < new Date()))
// Template libraries
eleventy.setLiquidOptions({
cache: true
})
// Extensions
eleventy.addExtension('css', require('./lib/extensions/css.js'))
// Filters
eleventy.addFilter('markdown', require('./lib/filters/markdown.js'))
// Shortcodes
eleventy.addShortcode('icon', require('./lib/shortcodes/icon.js'))
// Transforms
eleventy.addTransform('minify', require('./lib/transforms/minify.js'))
// Passthrough
eleventy.addPassthroughCopy({
'./src/assets/fonts/': '/assets/fonts',
'./src/assets/vectors/': '/assets/vectors',
'./src/images': '/images',
'./src/images/favicon.ico': '/favicon.ico',
'./src/CNAME': '/CNAME'
})
// Watch targets
eleventy.addWatchTarget('./src/assets/')
// Enable data deep merge
eleventy.setDataDeepMerge(true)
// Config
return {
dir: {
input: 'src',
includes: 'includes',
layouts: 'layouts',
data: 'data'
},
templateFormats: ['css', 'liquid', 'md'],
passthroughFileCopy: true
}
}