feat(blog) add cover images to RSS via <enclosure>

This commit is contained in:
Monty
2021-09-29 15:59:07 +02:00
parent d9a98edb21
commit 41e7d8c810
2 changed files with 3 additions and 1 deletions

View File

@@ -49,9 +49,10 @@ router.get('/', async (request, response) => {
// RSS feed
router.get('/feed.xml', async (request, response) => {
// Adds the pubDate to the post array
// Adds the pubDate and the cover_extension to the post array
const posts = postList().map((post) => {
post.postInfo.pubDate = new Date(post.postInfo.date).toUTCString();
post.postInfo.cover_extension = post.postInfo.cover_image.substring(post.postInfo.cover_image.lastIndexOf('.') + 1);
return post;
});