-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
36 lines (30 loc) · 944 Bytes
/
.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
const { DateTime } = require("luxon");
// @docs : config
// https://www.11ty.io/docs/config
module.exports = function(config) {
config.addLayoutAlias('default', 'default.njk');
config.addShortcode("year", dateObj => {
return DateTime.local().toFormat('yyyy');
});
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
config.addFilter('htmlDateString', (dateObj) => {
return DateTime.fromJSDate(dateObj).toFormat('yyyy-LL-dd');
});
config.addWatchTarget('./src/assets');
config.addPassthroughCopy('src/robots.txt');
config.addPassthroughCopy('src/humans.txt');
config.addPassthroughCopy('src/assets/css/main.css');
config.addPassthroughCopy('src/assets/images');
return {
dir: {
input: "src",
output: "dist",
includes: "includes",
layouts: "layouts",
data: "data"
},
templateFormats: ['njk', 'html'],
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk'
};
};