aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pages/feed.xml.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pages/feed.xml.js b/src/pages/feed.xml.js
new file mode 100644
index 0000000..0fcc82f
--- /dev/null
+++ b/src/pages/feed.xml.js
@@ -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 Popov’s Technology Blog",
+ });
+}