feat: enhance SEO and structured data across multiple components; update site description and improve sitemap and RSS feed

This commit is contained in:
cojocaru-david
2025-07-16 17:46:19 +03:00
parent cf4090da79
commit 0a8ceb09ad
15 changed files with 643 additions and 492 deletions

View File

@@ -8,15 +8,33 @@ export async function GET(context: APIContext) {
const posts = await getAllPosts()
return rss({
title: SITE.title,
title: `${SITE.title} - Tech Blog`,
description: SITE.description,
site: context.site ?? SITE.href,
trailingSlash: false,
items: posts.map((post) => ({
title: post.data.title,
description: post.data.description,
pubDate: post.data.date,
link: `/blog/${post.id}/`,
categories: post.data.tags || [],
author: post.data.authors ? post.data.authors.join(', ') : SITE.author,
customData: `
<language>${SITE.locale}</language>
<lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
${post.data.tags ? `<category>${post.data.tags.join(', ')}</category>` : ''}
`.trim(),
})),
customData: `
<language>${SITE.locale}</language>
<lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
<ttl>60</ttl>
<image>
<url>${new URL('/ogImage.png', SITE.href).toString()}</url>
<title>${SITE.title}</title>
<link>${SITE.href}</link>
</image>
`.trim(),
})
} catch (error) {
console.error('Error generating RSS feed:', error)