diff options
author | Valentin Popov <valentin@popov.link> | 2024-09-05 00:45:53 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-09-05 00:45:53 +0300 |
commit | 7770a0852c0ba9cb0790d447cb3af0a5bf00e2ba (patch) | |
tree | 97ddee442f7844a19add1c44a60578664d9ce9e0 /src/pages | |
parent | 536956f0f320d1cf4be0938d7836a1dee64b345a (diff) | |
download | popov.link-7770a0852c0ba9cb0790d447cb3af0a5bf00e2ba.tar.xz popov.link-7770a0852c0ba9cb0790d447cb3af0a5bf00e2ba.zip |
Added RSS
Diffstat (limited to 'src/pages')
-rw-r--r-- | src/pages/feed.xml.js | 20 |
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", + }); +} |