Fork of Chiri for Astro for my blog
6
fork

Configure Feed

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

fix(rss): add description field

the3ash 69103735 3ed8bf0b

+8 -1
+8 -1
src/utils/feed.ts
··· 72 72 format: 'webp', 73 73 width: 800 74 74 }) 75 - 75 + 76 76 // Always use the optimized image path in production 77 77 img.setAttribute('src', new URL(processedImage.src, baseUrl).toString()) 78 78 } ··· 145 145 } 146 146 }) 147 147 148 + // Generate plain text summary for description 149 + const plainText = sanitizeHtml(cleanHtml, { allowedTags: [], allowedAttributes: {} }) 150 + .replace(/\s+/g, ' ') 151 + .trim() 152 + const description = plainText.length > 200 ? plainText.slice(0, 200) + '...' : plainText 153 + 148 154 feed.addItem({ 149 155 title: post.data.title, 150 156 id: postUrl, 151 157 link: postUrl, 158 + description: description, 152 159 content: cleanHtml, 153 160 date: post.data.pubDate, 154 161 published: post.data.pubDate