blob: 9ff9801e0b30638b075887c8a2402f9c109362e5 [file] [log] [blame]
Samuel Shuert86826b82024-04-27 16:14:20 -04001import 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.slug}/`,
14 })),
15 });
16}