cheri.pink/.eleventy.js

38 lines
973 B
JavaScript
Raw Normal View History

2023-04-18 14:11:57 +00:00
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy ("src/media");
2023-09-07 07:05:34 +00:00
eleventyConfig.addPassthroughCopy ({ "src/resources": "/" });
2023-04-18 14:11:57 +00:00
eleventyConfig.addPassthroughCopy ("src/robots.txt");
eleventyConfig.addPlugin( require("@11ty/eleventy-plugin-rss") );
const {
DateTime
} = require("luxon");
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
eleventyConfig.addFilter('htmlDateString', (dateObj) => {
return DateTime.fromJSDate(dateObj, {
zone: 'utc'
}).toFormat('yyyy-MM-dd');
});
eleventyConfig.addFilter("readableDate", dateObj => {
return DateTime.fromJSDate(dateObj, {
zone: 'utc'
}).toFormat("yyyy-MM-dd");
});
2023-09-07 07:05:34 +00:00
eleventyConfig.addFilter("postDate", dateObj => {
return DateTime.fromJSDate(dateObj, {
zone: 'utc'
}).toFormat("DDDD");
});
2023-04-18 14:11:57 +00:00
return {
dir: {
input: "src",
output: "public",
},
};
};