-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
37 lines (31 loc) · 842 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
37
const dayjs = require("dayjs");
module.exports = function (config) {
// Pass-through images
config.addPassthroughCopy("./_site/images");
// Add Date filters
config.addFilter("date", (dateObj) => {
return dayjs(dateObj).format("MMMM D, YYYY");
});
config.addFilter("sitemapDate", (dateObj) => {
return dayjs(dateObj).toISOString();
});
config.addFilter("year", () => {
return dayjs().format("YYYY");
});
// Add pages collection
config.addCollection("pages", function (collections) {
return collections.getFilteredByTag("page").sort(function (a, b) {
return a.data.order - b.data.order;
});
});
return {
markdownTemplateEngine: "njk",
dir: {
input: "_site",
data: "_data",
includes: "_includes",
layouts: "_layouts",
output: "dist",
},
};
};