-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
27 lines (22 loc) · 908 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
const { DateTime } = require("luxon");
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const pluginRss = require("@11ty/eleventy-plugin-rss");
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy('./src/styles.css');
eleventyConfig.addPassthroughCopy('./src/assets');
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addCollection('post', (collection) => {
return [...collection.getFilteredByGlob('./src/blog/*.md')].reverse();
});
// eleventyConfig.addPlugin is from: https://www.11ty.dev/docs/plugins/syntaxhighlight/
eleventyConfig.addFilter("postDate", (dateObj) => {
return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_MED);
});
return {
dir: {
input: "src",
output: "public"
}
};
}