mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-31 23:16:54 +00:00
修复映射Notion数据库字段
This commit is contained in:
@@ -11,7 +11,7 @@ export default function getAllPageIds (collectionQuery, collectionId, collection
|
||||
view?.collection_group_results?.blockIds?.forEach(id => pageSet.add(id)) // table视图
|
||||
})
|
||||
pageIds = [...pageSet]
|
||||
console.log('PageIds: 从collectionQuery获取', collectionQuery)
|
||||
console.log('PageIds: 从collectionQuery获取', collectionQuery, pageIds.length)
|
||||
} else if (viewIds && viewIds.length > 0) {
|
||||
const ids = collectionView[viewIds[0]].value.page_sort
|
||||
console.log('PageIds: 从viewId获取', viewIds)
|
||||
|
||||
@@ -251,13 +251,21 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
|
||||
collectionData.push(properties)
|
||||
}
|
||||
}
|
||||
// 读取映射 配置
|
||||
console.log('当前Notion映射配置-(在blog.config.js中配置)', BLOG.NOTION_PROPERTY_NAME)
|
||||
const { type, status } = BLOG.NOTION_PROPERTY_NAME
|
||||
|
||||
const allPages = collectionData.filter(post => {
|
||||
return post.title && ['Page'].indexOf(post?.type?.[0]) > -1 && (post?.status?.[0] === 'Published' || post?.status?.[0] === 'Invisible')
|
||||
return post && post[type] &&
|
||||
['Page'].indexOf(post[type]?.[0]) > -1 &&
|
||||
(post[status]?.[0] === 'Published' || post[status]?.[0] === 'Invisible')
|
||||
})
|
||||
const allPosts = collectionData.filter(post => {
|
||||
return post.title && ['Post'].indexOf(post?.type?.[0]) > -1 && post?.status?.[0] === 'Published'
|
||||
return post && post[status] &&
|
||||
['Post'].indexOf(post[type]?.[0]) > -1 &&
|
||||
post[status]?.[0] === 'Published'
|
||||
})
|
||||
console.error('全部单页', allPages.length, '全部博客', allPosts.length)
|
||||
|
||||
// Sort by date
|
||||
if (BLOG.POSTS_SORT_BY === 'date') {
|
||||
|
||||
Reference in New Issue
Block a user