From 41e7d8c8105a2c2b5fe1cd7faa2fa28767aee86f Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 29 Sep 2021 15:59:07 +0200 Subject: [PATCH] feat(blog) add cover images to RSS via --- src/routers/blog.js | 3 ++- views/blog-rss.handlebars | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routers/blog.js b/src/routers/blog.js index 2e85cc4..2d72efc 100644 --- a/src/routers/blog.js +++ b/src/routers/blog.js @@ -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; }); diff --git a/views/blog-rss.handlebars b/views/blog-rss.handlebars index e23fe34..5522bca 100644 --- a/views/blog-rss.handlebars +++ b/views/blog-rss.handlebars @@ -22,6 +22,7 @@ https://pretendo.network/blog/{{this.slug}} https://pretendo.network/blog/{{this.slug}} {{ this.postInfo.pubDate }} + {{/each}}