aboutsummaryrefslogtreecommitdiff
path: root/src/pages/blog.xml.ts
blob: f16547516a045eb4d8751b931232addd33dabad3 (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: any) {
	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: any) => ({
			title: post.data.title,
			link: `${context.site}blog/${post.slug}`,
			description: post.data.metaDescription,
			pubDate: post.data.publishedAt
		}))
	})
}