-
Notifications
You must be signed in to change notification settings - Fork 0
/
eleventy.config.js
50 lines (40 loc) · 1.31 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require('dotenv').config()
const { EleventyHtmlBasePlugin } = require('@11ty/eleventy')
const date = require('./src/_filters/date')
const absoluteUrl = require('./src/_filters/absoluteUrl')
const validTags = require('./src/_filters/validTags')
const webcal = require('./src/_filters/webcal')
const { upcoming, limit, next } = require('./src/_filters/collections')
const showDate = require('./src/_methods/showDate')
const isPast = require('./src/_methods/isPast')
module.exports = config => {
config.addPlugin(EleventyHtmlBasePlugin)
config.addWatchTarget('./src/_assets/css')
// filters…
config.addFilter('date', date)
config.addFilter('absoluteUrl', absoluteUrl)
config.addFilter('validTags', validTags)
config.addFilter('webcal', webcal)
config.addFilter('isPast', isPast)
// collections…
config.addFilter('limit', limit)
config.addFilter('upcoming', upcoming)
config.addFilter('next', next)
// methods…
config.addNunjucksGlobal('showDate', showDate)
config.addNunjucksGlobal('isPast', isPast)
// shortcodes…
config.addShortcode('year', () => new Date().getFullYear())
config.addPassthroughCopy({
'src/_assets/img': 'img'
})
return {
dir: {
input: 'src',
output: 'dist',
data: '_data',
includes: '_includes',
layouts: '_layouts'
}
}
}