diff options
| author | houston[bot] <astrobot-houston@users.noreply.github.com> | 2025-10-19 18:30:51 +0200 |
|---|---|---|
| committer | Matthieu Pignolet <matthieu@puffer.fish> | 2025-10-19 18:30:51 +0200 |
| commit | e435718c4dd6e956dc1748689a6156129650c250 (patch) | |
| tree | 575ab9929930553253b9cf0a8b8843d48d7e6867 /src/pages/rss.xml.js | |
Initial commit from Astro
Diffstat (limited to 'src/pages/rss.xml.js')
| -rw-r--r-- | src/pages/rss.xml.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js new file mode 100644 index 0000000..1fa2b18 --- /dev/null +++ b/src/pages/rss.xml.js @@ -0,0 +1,16 @@ +import { getCollection } from 'astro:content'; +import rss from '@astrojs/rss'; +import { SITE_DESCRIPTION, SITE_TITLE } from '../consts'; + +export async function GET(context) { + const posts = await getCollection('blog'); + return rss({ + title: SITE_TITLE, + description: SITE_DESCRIPTION, + site: context.site, + items: posts.map((post) => ({ + ...post.data, + link: `/blog/${post.id}/`, + })), + }); +} |
