import { getAllPosts } from '@/lib/markdown' import { NextResponse } from 'next/server' export async function GET() { const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030' const posts = await getAllPosts('en', false) const rss = ` My Blog - Tech, Development & More ${baseUrl} Personal blog about software development, technology, and interesting projects ro-RO ${new Date().toUTCString()} ${posts .slice(0, 20) .map(post => { const postUrl = `${baseUrl}/blog/${post.slug}` return ` <![CDATA[${post.frontmatter.title}]]> ${postUrl} ${postUrl} ${new Date(post.frontmatter.date).toUTCString()} ${post.frontmatter.author} ` }) .join('')} ` return new NextResponse(rss, { headers: { 'Content-Type': 'application/xml', 'Cache-Control': 'public, s-maxage=3600, stale-while-revalidate', }, }) }