29 lines
No EOL
852 B
JavaScript
29 lines
No EOL
852 B
JavaScript
import rss, { pagesGlobToRssItems } from '@astrojs/rss';
|
|
|
|
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: Date.parse(post.frontmatter.date),
|
|
description: post.frontmatter.description,
|
|
link: `/blog/${post.frontmatter.slug}`,
|
|
|
|
|
|
customData: `
|
|
<subtitle>
|
|
<![CDATA[${post.frontmatter.subtitle ?? ''}]]>
|
|
</subtitle>
|
|
|
|
`,
|
|
})),
|
|
customData: `<language>de-de</language>`,
|
|
});
|
|
} |