my website
at main 16 lines 402 B view raw
1import rss from '@astrojs/rss'; 2import { getCollection } from 'astro:content'; 3import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; 4 5export async function GET(context) { 6 const posts = await getCollection('blog'); 7 return rss({ 8 title: SITE_TITLE, 9 description: SITE_DESCRIPTION, 10 site: context.site, 11 items: posts.map((post) => ({ 12 ...post.data, 13 link: `/blog/${post.id}/`, 14 })), 15 }); 16}