Something went wrong. Try again.
Fork of backnotprop/plannotator with reduced surface area
Something went wrong. Try again.
12345678910111213141516171819202122import rss from '@astrojs/rss';import { getCollection } from 'astro:content';import type { APIContext } from 'astro';
export async function GET(context: APIContext) { const posts = (await getCollection('blog')) .filter((post) => !post.data.draft) .sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
return rss({ title: 'Plannotator Blog', description: 'News and updates from Plannotator', site: context.site!, items: posts.map((post) => ({ title: post.data.title, description: post.data.description, pubDate: post.data.date, link: `/blog/${post.id}/`, })), });}