mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Notion数据库支持配置视图索引
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import BLOG from "@/blog.config"
|
||||
|
||||
export default function getAllPageIds (collectionQuery, collectionId, collectionView, viewIds) {
|
||||
if (!collectionQuery && !collectionView) {
|
||||
return []
|
||||
}
|
||||
// 优先按照第一个视图排序
|
||||
let pageIds = []
|
||||
try {
|
||||
// Notion数据库中的第几个视图用于站点展示和排序:
|
||||
const groupIndex = BLOG.NOTION_INDEX || 0
|
||||
if (viewIds && viewIds.length > 0) {
|
||||
const groupIndex = viewIds.length > 0 ? viewIds.length - 1 : 0
|
||||
const ids = collectionQuery[collectionId][viewIds[groupIndex]]?.collection_group_results?.blockIds || []
|
||||
for (const id of ids) {
|
||||
pageIds.push(id)
|
||||
|
||||
Reference in New Issue
Block a user