-
Notifications
You must be signed in to change notification settings - Fork 2
/
eleventy.config.js
36 lines (29 loc) · 970 Bytes
/
eleventy.config.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 pluginRss = require("@11ty/eleventy-plugin-rss");
const markdownIt = require("markdown-it");
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("src/assets");
eleventyConfig.addPassthroughCopy("src/favicon.ico");
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.setFrontMatterParsingOptions({
excerpt: true,
});
eleventyConfig.addFilter("md", function (content = "") {
return markdownIt({ html: true }).render(content);
});
eleventyConfig.addFilter("dateIso", date => {
return date.toISOString();
});
eleventyConfig.addFilter("dateReadable", date => {
return date.toDateString();
});
eleventyConfig.addCollection("posts", function(collection) {
return collection.getFilteredByGlob("src/news/*.md");
});
return {
dir: {
input: "src",
output: "dist",
includes: "_layouts"
}
};
}