Fork of Chiri for Astro for my blog
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Trying to fix images in RSS feed

+7 -2
+7 -2
src/utils/feed.ts
··· 69 69 width: 800 70 70 }) 71 71 72 - // Always use the optimized image path in production 73 - img.setAttribute('src', new URL(processedImage.src, baseUrl).toString()) 72 + // Strip Netlify image optimization wrapper, use the raw _astro path 73 + let src = processedImage.src 74 + if (src.includes('/.netlify/images')) { 75 + const urlParam = new URL(src, baseUrl).searchParams.get('url') 76 + src = urlParam ? `/${decodeURIComponent(urlParam)}` : src 77 + } 78 + img.setAttribute('src', new URL(src, baseUrl).toString()) 74 79 } 75 80 } catch (error) { 76 81 console.error(`[Feed] Image processing failed: ${src} -> ${resolvedPath}`, error)