mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 15:10:32 +00:00
lastEditTime 字段名调整;修改algolia逻辑
This commit is contained in:
@@ -25,7 +25,8 @@ export async function getGlobalData({
|
||||
from
|
||||
}) {
|
||||
// 从notion获取
|
||||
const db = deepClone(await getNotionPageData({ pageId, from }))
|
||||
const data = await getNotionPageData({ pageId, from })
|
||||
const db = deepClone(data)
|
||||
// 不返回的敏感数据
|
||||
delete db.block
|
||||
delete db.schema
|
||||
@@ -48,8 +49,8 @@ function getLatestPosts({ allPages, from, latestPostCount }) {
|
||||
const allPosts = allPages?.filter(page => page.type === 'Post' && page.status === 'Published')
|
||||
|
||||
const latestPosts = Object.create(allPosts).sort((a, b) => {
|
||||
const dateA = new Date(a?.lastEditedTime || a?.publishDate)
|
||||
const dateB = new Date(b?.lastEditedTime || b?.publishDate)
|
||||
const dateA = new Date(a?.lastEditedDay || a?.publishDate)
|
||||
const dateB = new Date(b?.lastEditedDay || b?.publishDate)
|
||||
return dateB - dateA
|
||||
})
|
||||
return latestPosts.slice(0, latestPostCount)
|
||||
@@ -217,7 +218,7 @@ const EmptyData = (pageId) => {
|
||||
const empty = {
|
||||
notice: null,
|
||||
siteInfo: getSiteInfo({}),
|
||||
allPages: [{ id: 1, title: `无法获取Notion数据,请检查Notion_ID: \n 当前 ${pageId}`, summary: '访问文档获取帮助→ https://tangly1024.com/article/vercel-deploy-notion-next', status: 'Published', type: 'Post', slug: '13a171332816461db29d50e9f575b00d', date: { start_date: '2023-04-24', lastEditedTime: '2023-04-24', tagItems: [] } }],
|
||||
allPages: [{ id: 1, title: `无法获取Notion数据,请检查Notion_ID: \n 当前 ${pageId}`, summary: '访问文档获取帮助→ https://tangly1024.com/article/vercel-deploy-notion-next', status: 'Published', type: 'Post', slug: '13a171332816461db29d50e9f575b00d', date: { start_date: '2023-04-24', lastEditedDay: '2023-04-24', tagItems: [] } }],
|
||||
allNavPages: [],
|
||||
collection: [],
|
||||
collectionQuery: {},
|
||||
|
||||
Reference in New Issue
Block a user