mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-29 15:10:06 +00:00
调整文章日期显示
This commit is contained in:
@@ -34,8 +34,8 @@ export async function getStaticProps() {
|
||||
const postsSortByDate = Object.create(props.posts)
|
||||
|
||||
postsSortByDate.sort((a, b) => {
|
||||
const dateA = new Date(a?.date?.start_date || a.createdTime)
|
||||
const dateB = new Date(b?.date?.start_date || b.createdTime)
|
||||
const dateA = new Date(a?.publishTime || a.createdTime)
|
||||
const dateB = new Date(b?.publishTime || b.createdTime)
|
||||
return dateB - dateA
|
||||
})
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export const getServerSideProps = async (ctx) => {
|
||||
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],
|
||||
lastmod: new Date(post?.publishTime || post?.createdTime).toISOString().split('T')[0],
|
||||
changefreq: 'daily',
|
||||
priority: '0.7'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user