This commit is contained in:
Morten Olsen
2024-03-30 20:53:01 +01:00
commit 98e39a54cc
94 changed files with 11654 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { data } from '@/data/data.ts';
import rss from '@astrojs/rss';
import type { APIContext } from 'astro';
export async function GET(context: APIContext) {
const articles = await data.articles.find();
const profile = data.profile;
return rss({
title: profile.basics.name,
description: profile.basics.tagline,
site: context.site || 'http://localhost:3000',
items: articles.map((article) => ({
...article.data,
link: `/articles/${article.slug}/`,
})),
});
}