-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
63 lines (56 loc) · 1.73 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
51
52
53
54
55
56
57
58
59
60
61
62
63
// @ts-nocheck -- 11ty has no type documentation
// import image from './11ty-plugins/image.js'
// import twemoji from './11ty-plugins/twemoji'
module.exports = function (config) {
config.addShortcode('image', require('./11ty-plugins/image'))
config.addFilter('twemoji', require('./11ty-plugins/twemoji'))
// config.addShortcode('image', image)
// config.addFilter('twemoji', twemoji)
config.addFilter("addOrigin", path => `https://benjic.xyz${path}`)
config.addPassthroughCopy(`src/static`)
config.addPassthroughCopy({
'src/static/images/pfp-2020.png': '/favicon.png'
})
config.addFilter('toDateTime', date => {
if (!(date instanceof Date)) {
date = new Date(date)
}
return date.toLocaleString('en-US', {
weekday: 'short',
month: 'short',
day: 'numeric',
year: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
hour12: false,
timeZone: 'America/Chicago'
})
})
config.addFilter('toDate', date => {
if (!(date instanceof Date)) {
date = new Date(date)
}
return date.toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric',
timeZone: 'America/Chicago'
})
})
config.addFilter('toISODateTime', date => {
if (!(date instanceof Date)) {
date = new Date(date)
}
return date.toISOString()
})
return {
dir: {
input: 'src',
output: 'dist',
data: 'data'
},
markdownTemplateEngine: "njk",
passthroughFileCopy: true
}
}