From 809c31f7928b00aa185ce1527680c16e40362814 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Mon, 13 Mar 2023 21:14:35 +0800 Subject: [PATCH] sitemap --- pages/sitemap.xml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/sitemap.xml.js b/pages/sitemap.xml.js index b17b3e45..8f753f5d 100644 --- a/pages/sitemap.xml.js +++ b/pages/sitemap.xml.js @@ -38,7 +38,7 @@ export const getServerSideProps = async (ctx) => { priority: '0.7' } ] - const postFields = allPages?.map(post => { + const postFields = allPages?.filter(p => p.status === BLOG.NOTION_PROPERTY_NAME.status_publish)?.map(post => { return { loc: `${BLOG.LINK}/${post.slug}`, lastmod: new Date(post?.date?.start_date || post?.createdTime).toISOString().split('T')[0],