added initial blog tryings

This commit is contained in:
Philipp Neumann
2025-05-17 20:39:14 +02:00
parent baf178afc5
commit dc1b552ac1
36 changed files with 2252 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
export async function GET(context) {
const posts = await getCollection('blog');
return rss({
title: SITE_TITLE,
description: SITE_DESCRIPTION,
site: context.site,
items: posts.map((post) => ({
...post.data,
link: `/blog/${post.id}/`,
})),
});
}