Skip to content

Commit

Permalink
Add XML namespace for media in RSS feed
Browse files Browse the repository at this point in the history
  • Loading branch information
miladsoft committed Dec 18, 2024
1 parent 5351109 commit 4c113ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export async function GET(context: APIContext) {
title: siteConfig.title,
description: siteConfig.subtitle || 'No description',
site: siteUrl,
xmlns: {
media: 'http://search.yahoo.com/mrss/',
},
items: blog.map((post) => {
const imageUrl = post.data.image
? new URL(post.data.image.startsWith('/') ? post.data.image.slice(1) : post.data.image, siteUrl).toString()
Expand All @@ -33,9 +36,6 @@ export async function GET(context: APIContext) {
: '',
};
}),
customData: `
<language>${siteConfig.lang}</language>
<xmlns:media="http://search.yahoo.com/mrss/">
`,
customData: `<language>${siteConfig.lang}</language>`,
});
}

0 comments on commit 4c113ba

Please sign in to comment.