You've already forked zblade.dev
feat(blog): add blog section and rss feed
- Add blog content collection schema and welcome post - Create blog index, post layout components, and dynamic routing - Add `@astrojs/rss` dependency and implement RSS feed generation - Add blog links to header and footer navigation - Update changelog with Gemini 3.1 Pro enhancement notes
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import type { APIContext } from 'astro';
|
||||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
export async function GET(context: APIContext) {
|
||||
const posts = await getCollection('blog', ({ data }) => {
|
||||
return import.meta.env.PROD ? data.draft !== true : true;
|
||||
});
|
||||
|
||||
return rss({
|
||||
title: 'Zaguán Blade Blog',
|
||||
description: 'Latest news, tutorials, and insights about AI-powered development with Zaguán Blade.',
|
||||
site: context.site ?? 'https://zblade.dev',
|
||||
items: posts.map((post) => ({
|
||||
title: post.data.title,
|
||||
pubDate: post.data.pubDate,
|
||||
description: post.data.description,
|
||||
link: `/blog/${post.slug}/`,
|
||||
})),
|
||||
customData: `<language>en-us</language>`,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user