diff --git a/atom.xml b/atom.xml index 30e9190..92af052 100644 --- a/atom.xml +++ b/atom.xml @@ -9,20 +9,18 @@ eleventyExcludeFromCollections: true {{ site.time | date_to_xmlschema }} - {{ site.url }} + {{ site.url }}/ {{ site.author.name }} - {{ site.author.email }} + {{ site.author.email }} {% for post in collections.posts %} {{ post.data.title | xml_escape }} {{ post.date | date_to_xmlschema }} - {{ site.url }}{{ post.id }} - + {{ site.url }}{{ post.url }} + {% endfor %} diff --git a/eleventy.config.cjs b/eleventy.config.cjs index 904e830..262b446 100644 --- a/eleventy.config.cjs +++ b/eleventy.config.cjs @@ -102,6 +102,21 @@ module.exports = (eleventyConfig) => { } ); + eleventyConfig.addLiquidFilter("date_to_xmlschema", function (input) { + const date = new Date(input); + return date.toISOString(); + }); + + eleventyConfig.addLiquidFilter("xml_escape", function (input) { + if (!input) return ""; + return input + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + }); + let markdownLib = markdownIt({ html: true, linkify: true }).use( markdownItAttrs, {