cheri.pink/.eleventy.js
2023-09-07 10:05:34 +03:00

37 lines
973 B
JavaScript

module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy ("src/media");
eleventyConfig.addPassthroughCopy ({ "src/resources": "/" });
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");
});
eleventyConfig.addFilter("postDate", dateObj => {
return DateTime.fromJSDate(dateObj, {
zone: 'utc'
}).toFormat("DDDD");
});
return {
dir: {
input: "src",
output: "public",
},
};
};