fix: sitemap slug undefined (#493)

This commit is contained in:
Steve Yu 2023-05-06 22:01:50 +08:00 committed by GitHub
parent 54b7ded4ad
commit 7ec85a002e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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(`