From eca0b50fffda4fd36f8affce219fee9710f0bc42 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Fri, 20 Mar 2026 21:06:59 +0100 Subject: [PATCH] Add images to rss feed Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- src/pages/rss.xml.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index 6958bec..68b6de1 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -11,6 +11,11 @@ export async function GET(context: APIContext) { pubDate: post.data.publishDate, description: post.data.description, link: `/blog/${post.id}/`, + enclosure: { + url: new URL(post.data.image.src, context.site).toString(), + length: 0, + type: "image/png", + }, })); const projectItems = projects.map((project) => ({ @@ -18,6 +23,11 @@ export async function GET(context: APIContext) { pubDate: new Date(), description: project.data.description, link: `/projects/${project.id}/`, + enclosure: { + url: new URL(project.data.image.src, context.site).toString(), + length: 0, + type: "image/png", + }, })); const allItems = [...blogItems, ...projectItems].sort( @@ -27,7 +37,7 @@ export async function GET(context: APIContext) { return rss({ title: "Another Hadi", description: - "Thoughts, insights, and tutorials on cybersecurity, OSINT, and technology.", + "Thoughts, insights, and tutorials on cybersecurity, OSINT, and technology.", site: context.site!, items: allItems, customData: `en`,