Initial commit from Astro

This commit is contained in:
houston[bot]
2024-12-08 21:35:59 +01:00
committed by Anton Pogrebnjak
commit f82a00b1da
36 changed files with 7139 additions and 0 deletions

16
src/pages/rss.xml.js Normal file
View File

@@ -0,0 +1,16 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
export async function GET(context) {
const posts = await getCollection('blog');
return rss({
title: SITE_TITLE,
description: SITE_DESCRIPTION,
site: context.site,
items: posts.map((post) => ({
...post.data,
link: `/blog/${post.id}/`,
})),
});
}