mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-23 15:09:46 +00:00
完善插件,顶部导航栏
This commit is contained in:
@@ -25,7 +25,13 @@ export async function getAllPosts ({ notionPageData, from, includePage = false }
|
||||
const collectionQuery = notionPageData.collectionQuery
|
||||
|
||||
const data = []
|
||||
if (!collectionQuery || collectionQuery.toString === '{}') {
|
||||
console.warn('列表查询条件为空', notionPageData)
|
||||
}
|
||||
const pageIds = getAllPageIds(collectionQuery)
|
||||
if (!pageIds || pageIds.length === 0) {
|
||||
console.warn('页面ID列表为空')
|
||||
}
|
||||
for (let i = 0; i < pageIds.length; i++) {
|
||||
const id = pageIds[i]
|
||||
const properties = (await getPageProperties(id, pageBlock, schema)) || null
|
||||
@@ -59,6 +65,9 @@ export async function getAllPosts ({ notionPageData, from, includePage = false }
|
||||
}
|
||||
})
|
||||
|
||||
if (!posts || posts.length === 0) {
|
||||
console.warn('文章列表为空')
|
||||
}
|
||||
// Sort by date
|
||||
if (BLOG.POSTS_SORT_BY === 'date') {
|
||||
posts.sort((a, b) => {
|
||||
|
||||
Reference in New Issue
Block a user