tiff-personal/src/pages/rss.xml.ts
houston[bot] 46709a2b20
Some checks failed
ci / Check for build and type issues (push) Has been cancelled
Initial commit from Astro
2025-04-22 15:19:27 -04:00

20 lines
478 B
TypeScript

import { getAllPosts } from "@/data/post";
import { siteConfig } from "@/site.config";
import rss from "@astrojs/rss";
export const GET = async () => {
const posts = await getAllPosts();
return rss({
title: siteConfig.title,
description: siteConfig.description,
site: import.meta.env.SITE,
items: posts.map((post) => ({
title: post.data.title,
description: post.data.description,
pubDate: post.data.publishDate,
link: `posts/${post.id}/`,
})),
});
};