Bluewaterblog/blog/src/pages/rss.xml.js
2026-10-06 13:56:13 +02:00

32 lines
No EOL
1,001 B
JavaScript

import rss from '@astrojs/rss';
import { formatLocalizedDateString } from '../lib/formatDate';
export async function GET(context) {
const posts = Object.values(
import.meta.glob("./blog/*.{md,mdx}", { eager: true })
);
return rss({
title: 'Blauwasser Mausis | Blog',
description: 'Segeln, Fahrrad, Abenteuer',
site: context.site,
items: posts.map(post => ({
title: post.frontmatter.title,
pubDate: post.frontmatter.date,
description: post.frontmatter.description,
link: `/blog/${post.frontmatter.slug}`,
author: post.frontmatter.author,
customData: `
<subtitle>
<![CDATA[${post.frontmatter.subtitle}]]>
</subtitle>
<time2read>
<![CDATA[${post.frontmatter.time2read}]]>
</time2read>
`,
})),
customData: `<language>de-de</language>`,
});
}