diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-03 13:09:53 +0300 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-03 13:09:53 +0300 |
| commit | 1e5f5a953588cefa75396454c9aed0a79552db14 (patch) | |
| tree | 733c5bcf71f009acc0bacfbc2269404330c82b5d /src/pages/micro/rss.xml.ts | |
| parent | 0bedb68753e7202326383fd10f7af563d7fbc24a (diff) | |
Migrate notes to micro
Diffstat (limited to 'src/pages/micro/rss.xml.ts')
| -rw-r--r-- | src/pages/micro/rss.xml.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pages/micro/rss.xml.ts b/src/pages/micro/rss.xml.ts new file mode 100644 index 0000000..7311319 --- /dev/null +++ b/src/pages/micro/rss.xml.ts @@ -0,0 +1,18 @@ +import { getCollection } from "astro:content"; +import { siteConfig } from "@/site.config"; +import rss from "@astrojs/rss"; + +export const GET = async () => { + const micro = await getCollection("note"); + + return rss({ + title: siteConfig.title, + description: siteConfig.description, + site: import.meta.env.SITE, + items: micro.map((note) => ({ + title: note.data.title, + pubDate: note.data.publishDate, + link: `micro/${note.id}/`, + })), + }); +}; |
