From 3ce1dab6a5574e04f8d61b40a92464bae7689eb9 Mon Sep 17 00:00:00 2001 From: Anuj Ahooja Date: Mon, 23 Feb 2026 16:47:04 -0800 Subject: [PATCH] Trying to fix images in RSS feed --- src/utils/feed.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/feed.ts b/src/utils/feed.ts index b5457f3..ef06ee8 100644 --- a/src/utils/feed.ts +++ b/src/utils/feed.ts @@ -69,8 +69,13 @@ async function fixRelativeImagePaths(htmlContent: string, baseUrl: string, postP width: 800 }) - // Always use the optimized image path in production - img.setAttribute('src', new URL(processedImage.src, baseUrl).toString()) + // Strip Netlify image optimization wrapper, use the raw _astro path + let src = processedImage.src + if (src.includes('/.netlify/images')) { + const urlParam = new URL(src, baseUrl).searchParams.get('url') + src = urlParam ? `/${decodeURIComponent(urlParam)}` : src + } + img.setAttribute('src', new URL(src, baseUrl).toString()) } } catch (error) { console.error(`[Feed] Image processing failed: ${src} -> ${resolvedPath}`, error) -- 2.51.2