Initial commit

This commit is contained in:
tiff 2025-04-28 23:32:21 -04:00 committed by GitHub
commit b3a42bb0c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
91 changed files with 9419 additions and 0 deletions

19
src/pages/rss.xml.js Normal file
View file

@ -0,0 +1,19 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import siteConfig from '../data/site-config.ts';
import { sortItemsByDateDesc } from '../utils/data-utils.ts';
export async function GET(context) {
const posts = (await getCollection('blog')).sort(sortItemsByDateDesc);
return rss({
title: siteConfig.title,
description: siteConfig.description,
site: context.site,
items: posts.map((item) => ({
title: item.data.title,
description: item.data.excerpt,
link: `/blog/${item.id}/`,
pubDate: item.data.publishDate.setUTCHours(0)
}))
});
}