-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
31 lines (29 loc) · 1.05 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
const rss = require("@11ty/eleventy-plugin-rss");
const footnote = require("markdown-it-footnote");
const { DateTime } = require("luxon");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(rss);
eleventyConfig.addPassthroughCopy("src/assets/fonts");
eleventyConfig.addPassthroughCopy("src/assets/css/normalize.css");
eleventyConfig.addPassthroughCopy("src/assets/css/fonts.css");
eleventyConfig.addPassthroughCopy("src/assets/css/style.css");
eleventyConfig.addFilter("postDate", (dateObj) => {
return DateTime.fromJSDate(dateObj).toUTC().toFormat("LLLL dd, yyyy");
});
eleventyConfig.addFilter("noRssOnlyPosts", (posts) => {
return posts.filter((post) => !post.data.tags.includes("RSS Only"));
});
eleventyConfig.addGlobalData("generated", () => {
return DateTime.now().toUTC();
});
eleventyConfig.amendLibrary("md", mdLib => mdLib.use(footnote));
return {
dir: {
input: "src",
data: "_data",
includes: "_includes",
layouts: "_layouts",
output: "_site",
}
};
};