fix: sitemap路径拼写不正确的问题

This commit is contained in:
2026-08-15 00:25:55 +08:00
parent 963722996e
commit f7929be18d
2 changed files with 2 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ const site = metadata.site
const staticUrls = [ const staticUrls = [
'', '',
'/archives', '/archive',
'/search', '/search',
]; ];

View File

@@ -18,7 +18,7 @@ export const GET: APIRoute = async (context) => {
const xml = `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> const xml = `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${urls.map((post) => `<url> ${urls.map((post) => `<url>
<loc>${site}/${post.slug}</loc> <loc>${site}/post/${post.slug}</loc>
<lastmod>${dayjs(post.updated_at || post.created_at).toISOString()}</lastmod> <lastmod>${dayjs(post.updated_at || post.created_at).toISOString()}</lastmod>
</url>` </url>`
) )