Prepare production deployment

This commit is contained in:
2026-07-20 04:14:24 +05:00
parent 55583e2101
commit 2e3550a4dc
46 changed files with 1497 additions and 882 deletions
+30
View File
@@ -0,0 +1,30 @@
import { posts } from '$lib/blog/posts';
import { canonical } from '$lib/config/site';
const staticPages = ['/', '/about', '/blog', '/dashboard'];
export const GET = () => {
const urls = [
...staticPages.map((path) => ({ loc: canonical(path), lastmod: undefined })),
...posts.map((post) => ({ loc: canonical(`/blog/${post.slug}`), lastmod: post.date }))
];
const body = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${urls
.map(
(url) => ` <url>
<loc>${url.loc}</loc>${url.lastmod ? `\n <lastmod>${url.lastmod}</lastmod>` : ''}
</url>`
)
.join('\n')}
</urlset>
`;
return new Response(body, {
headers: {
'content-type': 'application/xml; charset=utf-8',
'cache-control': 'public, max-age=3600'
}
});
};