From 5fc5eb67b1edeab87e6e540d3f147bc945ec2d12 Mon Sep 17 00:00:00 2001 From: ipatpat Date: Tue, 3 Jan 2023 19:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSitemap=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=A0=87=E7=AC=A6=E5=90=88W3C=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/sitemap.xml.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/sitemap.xml.js b/pages/sitemap.xml.js index 083edc0b..17980067 100644 --- a/pages/sitemap.xml.js +++ b/pages/sitemap.xml.js @@ -8,32 +8,32 @@ export const getServerSideProps = async (ctx) => { const defaultFields = [ { loc: `${BLOG.LINK}`, - lastmod: new Date(), + lastmod: new Date().toISOString().split('T')[0], changefreq: 'daily', priority: '0.7' }, { loc: `${BLOG.LINK}/archive`, - lastmod: new Date(), + lastmod: new Date().toISOString().split('T')[0], changefreq: 'daily', priority: '0.7' }, { loc: `${BLOG.LINK}/category`, - lastmod: new Date(), + lastmod: new Date().toISOString().split('T')[0], changefreq: 'daily', priority: '0.7' }, { loc: `${BLOG.LINK}/feed`, - lastmod: new Date(), + lastmod: new Date().toISOString().split('T')[0], changefreq: 'daily', priority: '0.7' }, { loc: `${BLOG.LINK}/search`, - lastmod: new Date(), + lastmod: new Date().toISOString().split('T')[0], changefreq: 'daily', priority: '0.7' }, { loc: `${BLOG.LINK}/tag`, - lastmod: new Date(), + lastmod: new Date().toISOString().split('T')[0], changefreq: 'daily', priority: '0.7' } @@ -41,7 +41,7 @@ export const getServerSideProps = async (ctx) => { const postFields = allPages?.map(post => { return { loc: `${BLOG.LINK}/${post.slug}`, - lastmod: new Date(post?.date?.start_date || post?.createdTime), + lastmod: new Date(post?.date?.start_date || post?.createdTime).toISOString().split('T')[0], changefreq: 'daily', priority: '0.7' }