mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-31 23:16:54 +00:00
完成单页初版本开发
This commit is contained in:
@@ -3,7 +3,7 @@ import { getDataFromCache, setDataToCache } from '@/lib/cache/cache_manager'
|
||||
import { getPostBlocks } from '@/lib/notion/getPostBlocks'
|
||||
import { idToUuid } from 'notion-utils'
|
||||
import { getAllCategories } from './getAllCategories'
|
||||
import { getAllPosts } from './getAllPosts'
|
||||
import { getAllPosts, getAllPostCount } from './getAllPosts'
|
||||
import { getAllTags } from './getAllTags'
|
||||
|
||||
/**
|
||||
@@ -33,8 +33,7 @@ export async function getGlobalNotionData ({
|
||||
const notionPageData = await getNotionPageData({ pageId, from })
|
||||
const tagOptions = notionPageData.tagOptions
|
||||
const allPosts = await getAllPosts({ notionPageData, from, pageType })
|
||||
const postCount = allPosts?.filter(post => post?.status?.[0] === 'Published' && (post?.type?.[0] === 'Post')
|
||||
)?.length
|
||||
const postCount = await getAllPostCount({ notionPageData, from })
|
||||
const customNav = await getCustomNav({ notionPageData })
|
||||
const categories = await getAllCategories(allPosts)
|
||||
const tags = await getAllTags({ allPosts, tagOptions, sliceCount: tagsCount })
|
||||
@@ -89,8 +88,13 @@ async function getCustomNav ({ notionPageData }) {
|
||||
return []
|
||||
}
|
||||
const allPage = await getAllPosts({ notionPageData, from: 'custom-nav', pageType: ['Page'] })
|
||||
console.log(allPage)
|
||||
return [{ icon: 'fas fa-file-alt', name: '简历', to: '/' + 'resume', show: true }]
|
||||
const customNav = []
|
||||
if (allPage && allPage.length > 0) {
|
||||
allPage.forEach(p => {
|
||||
customNav.push({ icon: p.icon, name: p.title, to: '/' + p.slug, show: true })
|
||||
})
|
||||
}
|
||||
return customNav
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user