~repos /website

#astro#js#html#css

git clone https://pyrossh.dev/repos/website.git

木 Personal website of pyrossh. Built with astrojs, shiki, vite.



src/pages/rss.xml.ts



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