a346517f02
also fix some urls and delete the original index.html (now in _content anyway)
42 lines
No EOL
1 KiB
JavaScript
42 lines
No EOL
1 KiB
JavaScript
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();
|
|
});
|
|
|
|
eleventyConfig.addPassthroughCopy("img");
|
|
eleventyConfig.addPassthroughCopy("js");
|
|
|
|
// Return your Object options:
|
|
return {
|
|
dir: {
|
|
input: "_content",
|
|
output: "pub"
|
|
},
|
|
templateFormats: ["md","html"]
|
|
}
|
|
}; |