Skip to content

Commit f7775c7

Browse files
committed
fix server sitemap date
1 parent 8e5e864 commit f7775c7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • frontend/main/src/pages/server-sitemap.xml

‎frontend/main/src/pages/server-sitemap.xml/index.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ const url = `${process.env.SITE_URL || 'https://codingcat.dev'}`;
1313
export const getServerSideProps: GetServerSideProps = async (ctx) => {
1414
const fields: ISitemapField[] = [];
1515
for (const type of [
16+
PostType.podcast,
17+
PostType.course,
1618
PostType.post,
1719
PostType.tutorial,
18-
PostType.podcast,
1920
PostType.page,
20-
PostType.course,
2121
]) {
2222
let docData;
23-
if (type == PostType.podcast) {
23+
if (type !== PostType.podcast) {
2424
docData = await (await queryByPublished(type, 10000)).results;
2525
} else {
2626
docData = await (await queryPurrfectStreamByReleased(10000)).results;
@@ -30,7 +30,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
3030
loc: `${url}/${doc._type}/${doc.slug}`,
3131
changefreq: 'daily',
3232
priority: 0.7,
33-
lastmod: new Date().toISOString(),
33+
lastmod: (doc?._updatedAt as string) || new Date().toISOString(),
3434
});
3535
}
3636
}

0 commit comments

Comments
 (0)