aboutsummaryrefslogtreecommitdiff
path: root/src/pages/blog.xml.js
diff options
context:
space:
mode:
authorAriel Costas Guerrero <94913521+arielcostas@users.noreply.github.com>2024-08-21 10:10:38 +0200
committerGitHub <noreply@github.com>2024-08-21 10:10:38 +0200
commitdd23cbd8a1caf00f0b842aff514d2907d545a403 (patch)
tree8fe6ba45871480f4fd352e567cae0b66ca4ccd04 /src/pages/blog.xml.js
parent553f8739ebd00110f649ce10440f1029766725a7 (diff)
Bring back the blog
Diffstat (limited to 'src/pages/blog.xml.js')
-rw-r--r--src/pages/blog.xml.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pages/blog.xml.js b/src/pages/blog.xml.js
new file mode 100644
index 0000000..b4fbe38
--- /dev/null
+++ b/src/pages/blog.xml.js
@@ -0,0 +1,19 @@
+import rss from '@astrojs/rss';
+import { getCollection } from 'astro:content';
+
+
+export async function GET(context) {
+ const collection = await getCollection('blog');
+
+ return rss({
+ title: "Blog de Ariel Costas",
+ description: "Artículos del blog de Ariel Costas",
+ site: context.site,
+ items: collection.map((post) => ({
+ title: post.data.title,
+ link: `${context.site}blog/${post.slug}`,
+ description: post.data.metaDescription,
+ pubDate: post.data.publishedAt
+ }))
+ })
+}