mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
18 lines
502 B
TypeScript
18 lines
502 B
TypeScript
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}/`,
|
|
})),
|
|
});
|
|
}
|