Initial rewrite

This commit is contained in:
Andras Schmelczer 2026-05-10 19:05:30 +01:00
parent a5f64a3ff8
commit 0d183c8335
200 changed files with 12537 additions and 18659 deletions

23
src/pages/rss.xml.ts Normal file
View file

@ -0,0 +1,23 @@
import rss from '@astrojs/rss';
import type { APIRoute } from 'astro';
import { articlePath, getPublishedPosts, site } from '../lib/site';
export const GET: APIRoute = async (context) => {
const posts = await getPublishedPosts();
return rss({
title: site.name,
description: site.description,
site: context.site ?? site.url,
items: posts.map((post) => ({
title: post.data.title,
description: post.data.description,
pubDate: post.data.date,
link: articlePath(post),
categories: post.data.tags,
customData: post.data.updated
? `<updated>${post.data.updated.toISOString()}</updated>`
: undefined,
})),
});
};