36 lines
865 B
JavaScript
36 lines
865 B
JavaScript
|
|
module.exports = function (eleventyConfig) {
|
||
|
|
eleventyConfig.addPassthroughCopy("css");
|
||
|
|
|
||
|
|
eleventyConfig.addCollection("columns", function (collectionApi) {
|
||
|
|
return collectionApi
|
||
|
|
.getFilteredByGlob("columns/**/*.md")
|
||
|
|
.sort((a, b) => b.date - a.date);
|
||
|
|
});
|
||
|
|
|
||
|
|
eleventyConfig.addFilter("year", function (date) {
|
||
|
|
return new Date(date).getFullYear();
|
||
|
|
});
|
||
|
|
|
||
|
|
eleventyConfig.addFilter("isoDate", function (date) {
|
||
|
|
return new Date(date).toISOString().split("T")[0];
|
||
|
|
});
|
||
|
|
|
||
|
|
eleventyConfig.addFilter("readableDate", function (date) {
|
||
|
|
return new Date(date).toLocaleDateString("en-US", {
|
||
|
|
year: "numeric",
|
||
|
|
month: "long",
|
||
|
|
day: "numeric",
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
return {
|
||
|
|
dir: {
|
||
|
|
input: ".",
|
||
|
|
includes: "_includes",
|
||
|
|
output: "_site",
|
||
|
|
},
|
||
|
|
markdownTemplateEngine: "njk",
|
||
|
|
htmlTemplateEngine: "njk",
|
||
|
|
};
|
||
|
|
};
|