Adding RSS support
This commit is contained in:
parent
ecd697c489
commit
6773a5be12
4 changed files with 45 additions and 1 deletions
19
src/pages/blog/rss.xml.js
Normal file
19
src/pages/blog/rss.xml.js
Normal 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}`,
|
||||
})),
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue