Properly use updated field from note in RSS feed

This commit is contained in:
Ole Eskild Steensen 2023-03-16 23:12:47 +01:00
parent 10a713d0d3
commit cd0e8b98ee
2 changed files with 6 additions and 1 deletions

View File

@ -325,6 +325,11 @@ module.exports = function (eleventyConfig) {
singleTags: ["link"]
}
});
eleventyConfig.addFilter("dateToZulu", function(date){
if(!date) return "";
return new Date(date).toISOString("dd-MM-yyyyTHH:mm:ssZ");
});
eleventyConfig.addFilter("jsonify", function (variable) {
return JSON.stringify(variable) || '""';
});

View File

@ -18,7 +18,7 @@
{% else %}{{ note.fileSlug }}
{% endif %}
</title>
<updated>{{ (note.updated or note.date ) | dateToRfc3339 }}</updated>
<updated>{%if note.data.updated %}{{ note.data.updated | dateToZulu }}{%else%}{{ note.date | dateToRfc3339 }}{%endif%}</updated>
<id>{{ meta.siteBaseUrl }}{{note.url | url }}</id>
<content type="html">
{{ note.templateContent | hideDataview | link | taggify | htmlToAbsoluteUrls(meta.siteBaseUrl) }}