BugFix: 丢失CustomNav

This commit is contained in:
tangly1024
2022-02-28 14:37:27 +08:00
parent a598f61600
commit d67d9227c5
15 changed files with 49 additions and 43 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}