Skip to content

Commit

Permalink
feat: add image for feed
Browse files Browse the repository at this point in the history
  • Loading branch information
thedaviddias committed Jun 12, 2023
1 parent 4ee5165 commit d032cb9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/generateRss.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default async function generateRssFeed() {
const date = new Date()
const author = {
name: 'David Dias',
email: 'hello@thedaviddias.dev',
email: 'thedaviddias@gmail.com',
link: 'https://twitter.com/thedaviddias',
}

Expand All @@ -38,7 +38,7 @@ export default async function generateRssFeed() {
description: localeEN.home.seo.description,
id: siteURL,
link: siteURL,
language: 'en',
language: 'en-US',
image: `${siteURL}/favicons/android-chrome-144x144.png`,
favicon: `${siteURL}/favicons/android-chrome-144x144.png`,
copyright: `All rights reserved ${date.getFullYear()}, David Dias`,
Expand All @@ -50,6 +50,8 @@ export default async function generateRssFeed() {
author,
})

feedEn.addCategory('Technology')

// Adding blogs to the rss feed
for (const post of postsEn) {
const url = `${siteURL}${post.permalink}`
Expand All @@ -73,6 +75,7 @@ export default async function generateRssFeed() {
author: [author],
contributor: [author],
date: new Date(post.frontMatter.date),
image: post.frontMatter.preview.url,
})
}

Expand All @@ -99,6 +102,8 @@ export default async function generateRssFeed() {
author,
})

feedFr.addCategory('Technologie')

// Adding blogs to the rss feed
for (const post of postsFr) {
const url = `${siteURL}${post.permalink}`
Expand All @@ -122,6 +127,7 @@ export default async function generateRssFeed() {
author: [author],
contributor: [author],
date: new Date(post.frontMatter.date),
image: post.frontMatter.preview.url,
})
}

Expand Down

0 comments on commit d032cb9

Please sign in to comment.