fixed invalid post title breaking links

This commit is contained in:
2026-05-09 05:59:56 +02:00
parent bd18b96846
commit 801df057e0
6 changed files with 23 additions and 16 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ export const GET: APIRoute = async ({ site }) => {
const items = posts
.filter(p => !p.draft)
.map(p => {
const url = `${origin}/posts/${p.slug}`;
const url = `${origin}/posts/${encodeURIComponent(p.slug)}`;
const description = p.summary || p.excerpt || '';
const pubDate = new Date(p.date).toUTCString();
const categories = p.tags.map(t => ` <category>${escapeXml(t)}</category>`).join('\n');