This commit is contained in:
Morten Olsen
2024-04-19 20:51:52 +02:00
committed by Morten Olsen
parent 98e39a54cc
commit ee37ac9d90
51 changed files with 604 additions and 798 deletions

View File

@@ -1,17 +1,17 @@
import { data } from '@/data/data.ts';
import rss from '@astrojs/rss';
import type { APIContext } from 'astro';
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;
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}/`,
})),
});
link: `/articles/${article.slug}/`
}))
})
}