aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/pages/rss.xml.js
blob: fe057559e33ebd7b58375371b3d5f8571069eed9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';

export async function GET(context) {
	const posts = await getCollection('blog');

	return rss({
		title: 'Polyfrost Blog',
		description: 'Recieve Polyfrost updates here',
		site: context.site,
		items: posts.map(post => ({
			...post.data,
			link: `/blog/${post.slug}/`,
		})),
	});
}