Add sitemap.xml

This commit is contained in:
Mathias Bynens
2018-09-24 15:09:15 -04:00
parent 4a517aecc1
commit 096ff9f3de
5 changed files with 26 additions and 2 deletions

View File

@@ -12,6 +12,11 @@ module.exports = function(eleventyConfig) {
return DateTime.fromJSDate(dateObj).toFormat("dd LLL yyyy");
});
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
eleventyConfig.addFilter('htmlDateString', (dateObj) => {
return DateTime.fromJSDate(dateObj).toFormat('yyyy-LL-dd');
});
// only content in the `posts/` directory
eleventyConfig.addCollection("posts", function(collection) {
return collection.getAllSorted().filter(function(item) {