2022-11-30 05:48:51 +00:00
|
|
|
module.exports = function(eleventyConfig) {
|
|
|
|
|
|
|
|
eleventyConfig.addFilter("formatDate", function(value) {
|
|
|
|
try{
|
|
|
|
const date = new Date(value)
|
|
|
|
if(date) return date.toISOString().replace('T', ' ').slice(0, -5)
|
|
|
|
else throw 'Unrecognized data format'
|
|
|
|
}
|
|
|
|
catch(e) {
|
|
|
|
console.log(`Could not convert "${value}"`, e)
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
eleventyConfig.addFilter("dateISOString", function(value) {
|
|
|
|
try{
|
|
|
|
const date = new Date(value)
|
|
|
|
if(date) return date.toISOString()
|
|
|
|
else throw 'Unrecognized data format'
|
|
|
|
}
|
|
|
|
catch(e) {
|
|
|
|
console.log(`Could not convert "${value}"`, e)
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
eleventyConfig.addCollection("notes", function(collectionApi) {
|
|
|
|
return collectionApi.getFilteredByGlob("_content/notes/*.md").reverse();
|
|
|
|
});
|
|
|
|
|
2022-11-30 10:42:50 +00:00
|
|
|
eleventyConfig.addPassthroughCopy({"img":"assets/img"});
|
|
|
|
eleventyConfig.addPassthroughCopy({"js":"assets/js"});
|
2022-11-30 10:25:25 +00:00
|
|
|
eleventyConfig.addPassthroughCopy("css");
|
2022-11-30 10:21:48 +00:00
|
|
|
|
2022-11-30 05:48:51 +00:00
|
|
|
// Return your Object options:
|
|
|
|
return {
|
|
|
|
dir: {
|
|
|
|
input: "_content",
|
|
|
|
output: "pub"
|
|
|
|
},
|
|
|
|
templateFormats: ["md","html"]
|
|
|
|
}
|
|
|
|
};
|