From fe7c149811f2e20c055ad0375aff05d29491efb4 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> Date: Sat, 4 May 2024 01:05:04 +0200 Subject: Rebuild the site in Astro Add licence Update site name in header to match README.md Add missing metadescription, opengraph and link to RSS Update Astro configuration to include sitemap integration with priority and changefreq settings New post --- src/pages/blog.xml.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/pages/blog.xml.js (limited to 'src/pages/blog.xml.js') diff --git a/src/pages/blog.xml.js b/src/pages/blog.xml.js new file mode 100644 index 0000000..ec8d424 --- /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 + })) + }) +} \ No newline at end of file -- cgit v1.3