完善插件,顶部导航栏

This commit is contained in:
tangly1024
2022-01-24 17:47:01 +08:00
parent bfadca7ccb
commit b1e7fd6f50
8 changed files with 285 additions and 2 deletions

View File

@@ -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) => {