-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eleventy.js
32 lines (29 loc) · 1.08 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
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const dateToISO8601 = require("./src/scripts/dateToISO8601.js");
module.exports = (eleventyConfig) => {
eleventyConfig.addPassthroughCopy("src/assets");
eleventyConfig.addPlugin(EleventyHtmlBasePlugin, {
baseHref: (process.env.NODE_ENV === "production" ? "https://until-tsukuba.github.io" : "http://localhost:8080")
});
eleventyConfig.addPlugin(pluginRss, {
posthtmlRenderOptions: {
closingSingleTag: "slash"
}
});
eleventyConfig.addPassthroughCopy({
"./node_modules/chota/dist/chota.min.css" : "/assets/css/chota.min.css"
})
eleventyConfig.addNunjucksFilter("getNewestCollectionItemDate", pluginRss.getNewestCollectionItemDate)
eleventyConfig.addNunjucksFilter("dateToRfc3339", pluginRss.dateToRfc3339)
eleventyConfig.addNunjucksFilter("dateToISO8601", dateToISO8601);
eleventyConfig.addNunjucksFilter("date", function(str) {
return new Date(str);
});
return {
dir: {
input: "src",
output: "public",
}
}
}