Adding RSS support

This commit is contained in:
Timothy Rogers 2025-02-09 10:36:10 -05:00
parent ecd697c489
commit 6773a5be12
4 changed files with 45 additions and 1 deletions

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

@ -0,0 +1,19 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
export async function GET(context) {
const Blog = await getCollection("blog");
return rss({
title: "Hack13 Ramblings",
description: "A fox with a blog, that rambles about tech, games, and life.",
site: "https://hack13.me",
feed_url: "https://hack13.me/blog/rss.xml",
image_url: "https://hack13.me/favicon.png",
items: Blog.map((post) => ({
title: post.data.title,
pubDate: post.data.published,
description: post.data.description,
link: `https://hack13.me/blog/${post.slug}`,
})),
});
}