fix: sitemap路径拼写不正确的问题
This commit is contained in:
@@ -5,7 +5,7 @@ const site = metadata.site
|
|||||||
|
|
||||||
const staticUrls = [
|
const staticUrls = [
|
||||||
'',
|
'',
|
||||||
'/archives',
|
'/archive',
|
||||||
'/search',
|
'/search',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -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>`
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user