summaryrefslogtreecommitdiff
path: root/src/pages/notes/rss.xml.ts
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-03 10:56:21 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-03 10:56:21 +0300
commit456cf011b36de91c9936994b1fa45703adcd309b (patch)
tree8e60daf998f731ac50d100fa490eaecae1168042 /src/pages/notes/rss.xml.ts
Initial fork of chrismwilliams/astro-theme-cactus theme
Diffstat (limited to 'src/pages/notes/rss.xml.ts')
-rw-r--r--src/pages/notes/rss.xml.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pages/notes/rss.xml.ts b/src/pages/notes/rss.xml.ts
new file mode 100644
index 0000000..0f1f945
--- /dev/null
+++ b/src/pages/notes/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 notes = await getCollection("note");
+
+ return rss({
+ title: siteConfig.title,
+ description: siteConfig.description,
+ site: import.meta.env.SITE,
+ items: notes.map((note) => ({
+ title: note.data.title,
+ pubDate: note.data.publishDate,
+ link: `notes/${note.id}/`,
+ })),
+ });
+};