aboutsummaryrefslogtreecommitdiff
path: root/src/pages/blog.xml.js
blob: ec8d42476e9f731756e76c1846804dbd134f3e2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
		}))
	})
}