0
mirror of https://github.com/valentineus/popov.link.git synced 2025-07-04 16:40:26 +03:00

Added RSS

This commit is contained in:
2024-09-04 21:45:53 +00:00
parent 536956f0f3
commit 7770a0852c
3 changed files with 60 additions and 0 deletions

20
src/pages/feed.xml.js Normal file
View File

@ -0,0 +1,20 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
export async function GET(context) {
const posts = await getCollection("blog");
return rss({
customData: `<language>ru-ru</language>`,
description: "Tech insights and coding best practices from an OpenSource enthusiast and ethical hacker.",
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,
title: "Valentin Popovs Technology Blog",
});
}