mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-03 15:10:19 +00:00
BugFix: 丢失CustomNav
This commit is contained in:
@@ -3,7 +3,7 @@ import React from 'react'
|
||||
import { LayoutArchive } from '@/themes'
|
||||
|
||||
export async function getStaticProps () {
|
||||
const { allPosts, categories, tags, postCount } =
|
||||
const { allPosts, categories, tags, postCount, customNav } =
|
||||
await getGlobalNotionData({ from: 'archive-index' })
|
||||
|
||||
return {
|
||||
@@ -11,7 +11,8 @@ export async function getStaticProps () {
|
||||
posts: allPosts,
|
||||
tags,
|
||||
categories,
|
||||
postCount
|
||||
postCount,
|
||||
customNav
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ export async function getStaticProps ({ params }) {
|
||||
categories,
|
||||
tags,
|
||||
postCount,
|
||||
latestPosts
|
||||
latestPosts,
|
||||
customNav
|
||||
} = await getGlobalNotionData({ from })
|
||||
const filteredPosts = allPosts.filter(
|
||||
post => post && post.category && post.category.includes(category)
|
||||
@@ -26,7 +27,8 @@ export async function getStaticProps ({ params }) {
|
||||
category,
|
||||
categories,
|
||||
postCount,
|
||||
latestPosts
|
||||
latestPosts,
|
||||
customNav
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function Category (props) {
|
||||
|
||||
export async function getStaticProps () {
|
||||
const from = 'category-index-props'
|
||||
const { allPosts, categories, tags, postCount, latestPosts } = await getGlobalNotionData({ from })
|
||||
const { allPosts, categories, tags, postCount, latestPosts, customNav } = await getGlobalNotionData({ from })
|
||||
|
||||
return {
|
||||
props: {
|
||||
@@ -16,7 +16,8 @@ export async function getStaticProps () {
|
||||
allPosts,
|
||||
categories,
|
||||
postCount,
|
||||
latestPosts
|
||||
latestPosts,
|
||||
customNav
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
|
||||
@@ -29,7 +29,8 @@ export async function getStaticProps ({ params: { page } }) {
|
||||
latestPosts,
|
||||
categories,
|
||||
tags,
|
||||
postCount
|
||||
postCount,
|
||||
customNav
|
||||
} = await getGlobalNotionData({ from })
|
||||
const meta = {
|
||||
title: `${page} | Page | ${BLOG.TITLE}`,
|
||||
@@ -62,7 +63,8 @@ export async function getStaticProps ({ params: { page } }) {
|
||||
latestPosts,
|
||||
tags,
|
||||
categories,
|
||||
meta
|
||||
meta,
|
||||
customNav
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ export async function getStaticProps () {
|
||||
categories,
|
||||
tags,
|
||||
postCount,
|
||||
latestPosts
|
||||
latestPosts,
|
||||
customNav
|
||||
} = await getGlobalNotionData({ from: 'search-props', pageType: ['Post'] })
|
||||
return {
|
||||
props: {
|
||||
@@ -15,7 +16,8 @@ export async function getStaticProps () {
|
||||
tags,
|
||||
categories,
|
||||
postCount,
|
||||
latestPosts
|
||||
latestPosts,
|
||||
customNav
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ export async function getStaticProps ({ params }) {
|
||||
categories,
|
||||
tags,
|
||||
postCount,
|
||||
latestPosts
|
||||
latestPosts,
|
||||
customNav
|
||||
} = await getGlobalNotionData({
|
||||
from,
|
||||
includePage: false,
|
||||
@@ -29,7 +30,8 @@ export async function getStaticProps ({ params }) {
|
||||
tag,
|
||||
categories,
|
||||
postCount,
|
||||
latestPosts
|
||||
latestPosts,
|
||||
customNav
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
|
||||
@@ -8,14 +8,15 @@ const TagIndex = (props) => {
|
||||
|
||||
export async function getStaticProps () {
|
||||
const from = 'tag-index-props'
|
||||
const { categories, tags, postCount, latestPosts } = await getGlobalNotionData({ from, tagsCount: 0 })
|
||||
const { categories, tags, postCount, latestPosts, customNav } = await getGlobalNotionData({ from, tagsCount: 0 })
|
||||
|
||||
return {
|
||||
props: {
|
||||
tags,
|
||||
categories,
|
||||
postCount,
|
||||
latestPosts
|
||||
latestPosts,
|
||||
customNav
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user