mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 07:26:45 +00:00
menu
This commit is contained in:
@@ -100,8 +100,8 @@ function getCustomNav({ allPages }) {
|
|||||||
* @param {*} allPages
|
* @param {*} allPages
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function getCustomMenu({ allPages }) {
|
function getCustomMenu({ collectionData }) {
|
||||||
const menuPages = allPages.filter(post => (post.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) && post.status === BLOG.NOTION_PROPERTY_NAME.status_publish)
|
const menuPages = collectionData.filter(post => (post.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) && post.status === BLOG.NOTION_PROPERTY_NAME.status_publish)
|
||||||
const menus = []
|
const menus = []
|
||||||
if (menuPages && menuPages.length > 0) {
|
if (menuPages && menuPages.length > 0) {
|
||||||
menuPages.forEach(e => {
|
menuPages.forEach(e => {
|
||||||
@@ -244,7 +244,7 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
|
|||||||
const siteInfo = getBlogInfo({ collection, block })
|
const siteInfo = getBlogInfo({ collection, block })
|
||||||
const customNav = getCustomNav({ allPages: collectionData.filter(post => post.type === 'Page' && post.status === 'Published') })
|
const customNav = getCustomNav({ allPages: collectionData.filter(post => post.type === 'Page' && post.status === 'Published') })
|
||||||
// 新的菜单
|
// 新的菜单
|
||||||
const customMenu = await getCustomMenu({ allPages })
|
const customMenu = await getCustomMenu({ collectionData })
|
||||||
const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 })
|
const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 })
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user