fix: sitemap slug undefined (#493)

This commit is contained in:
Steve Yu
2023-05-06 15:01:50 +01:00
committed by GitHub
parent 54b7ded4ad
commit 7ec85a002e
+1 -1
View File
@@ -34,7 +34,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${pages.list?.map(
(page: any) => ` <url>
<loc>${link}/${page.slug || page.id}</loc>
<loc>${link}/${page.metadata.content.slug}</loc>
<lastmod>${dayjs(page.date_updated).format("YYYY-MM-DD")}</lastmod>
</url>`,
).join(`