mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-03-31 06:04:54 -05:00
feat(blog) add cover images to RSS via <enclosure>
This commit is contained in:
parent
d9a98edb21
commit
41e7d8c810
|
|
@ -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;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
<link>https://pretendo.network/blog/{{this.slug}}</link>
|
||||
<guid>https://pretendo.network/blog/{{this.slug}}</guid>
|
||||
<pubDate>{{ this.postInfo.pubDate }}</pubDate>
|
||||
<enclosure url="{{ this.postInfo.cover_image }}" length="0" type="image/{{ this.postInfo.cover_extension }}"/>
|
||||
</item>
|
||||
{{/each}}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user