From d632fd8a6e29c1fbfdd2d959c6e6f950ba097e4c Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Fri, 16 Jan 2026 09:08:18 -0500 Subject: [PATCH] feat(rss): include cover images as enclosures Use getPostImage to resolve cover images for each post and include them as RSS enclosure elements. Falls back to default cover if no custom cover.png exists. --- src/pages/rss.xml.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index ec9aada..ebcba12 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -3,6 +3,7 @@ import { getCollection } from 'astro:content'; import type { APIContext } from 'astro'; import sanitizeHtml from 'sanitize-html'; import MarkdownIt from 'markdown-it'; +import { getPostImage } from '../lib/posts'; const parser = new MarkdownIt(); @@ -49,13 +50,12 @@ export async function GET(context: APIContext) { }), }; - if (post.data.image) { - item.enclosure = { - url: `${site}${post.data.image.src}`, - type: getMimeType(post.data.image.src), - length: 0, - }; - } + const image = getPostImage(post); + item.enclosure = { + url: `${site}${image.src}`, + type: getMimeType(image.src), + length: 0, + }; // Add custom data for bluesky post ID if present if (post.data.blueskyPostId) {