0
mirror of https://github.com/valentineus/popov.link.git synced 2025-10-24 18:14:06 +03:00
Files
popov.link/src/pages/feed.xml.js

21 lines
545 B
JavaScript
Raw Normal View History

2024-09-04 21:45:53 +00:00
import { getCollection } from "astro:content";
2024-09-06 08:21:27 +00:00
import rss from "@astrojs/rss";
2024-09-04 21:45:53 +00:00
export async function GET(context) {
const posts = await getCollection("blog");
return rss({
customData: `<language>ru-ru</language>`,
2024-09-11 22:03:55 +00:00
description: import.meta.env.DEFAULT_DESCRIPTION,
2024-09-04 21:45:53 +00:00
items: posts.map((post) => ({
customData: post.data.customData,
description: post.data.description,
link: `/blog/${post.slug}`,
pubDate: post.data.pubDate,
title: post.data.title,
})),
site: context.site,
2024-09-11 22:03:55 +00:00
title: import.meta.env.DEFAULT_TITLE,
2024-09-04 21:45:53 +00:00
});
}