diff --git a/pages/about.js b/pages/about.js index 28a93342..0ccfeae3 100644 --- a/pages/about.js +++ b/pages/about.js @@ -21,7 +21,7 @@ import React from 'react' * @param {*} param0 * @returns */ -const About = ({ post, blockMap, tags, prev, next, allPosts, categories }) => { +const About = ({ post, blockMap, tags, prev, next, postCount, categories }) => { if (!post) { return } @@ -39,10 +39,10 @@ const About = ({ post, blockMap, tags, prev, next, allPosts, categories }) => { meta={meta} tags={tags} post={post} - totalPosts={allPosts} + postCount={postCount} categories={categories} > - + ) } @@ -69,7 +69,7 @@ export async function getStaticProps () { const next = allPosts.slice(index + 1, index + 2)[0] ?? allPosts[0] return { - props: { post, blockMap, tags, prev, next, allPosts, categories, postCount, latestPosts }, + props: { post, blockMap, tags, prev, next, categories, postCount, latestPosts }, revalidate: 1 } } diff --git a/pages/article/[slug].js b/pages/article/[slug].js index 8f055522..0a5c4bbb 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -16,7 +16,6 @@ const Slug = ({ tags, prev, next, - allPosts, recommendPosts, categories, postCount, @@ -39,7 +38,6 @@ const Slug = ({ post={post} postCount={postCount} latestPosts={latestPosts} - totalPosts={allPosts} categories={categories} > { +const Search = ({ posts, tags, categories, postCount }) => { let filteredPosts = [] const searchKey = getSearchKey() if (searchKey) { diff --git a/pages/tag/index.js b/pages/tag/index.js index 54405469..6977f37d 100644 --- a/pages/tag/index.js +++ b/pages/tag/index.js @@ -7,14 +7,14 @@ import { faTags } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import React from 'react' -export default function Tag ({ tags, allPosts, categories, postCount, latestPosts }) { +export default function Tag ({ tags, categories, postCount, latestPosts }) { const { locale } = useGlobal() const meta = { title: `${locale.COMMON.TAGS} | ${BLOG.title}`, description: BLOG.description, type: 'website' } - return + return
{locale.COMMON.TAGS}:
@@ -28,12 +28,11 @@ export default function Tag ({ tags, allPosts, categories, postCount, latestPost export async function getStaticProps () { const from = 'tag-index-props' - const { allPosts, categories, tags, postCount, latestPosts } = await getGlobalNotionData({ from, includePage: true, tagsCount: 0 }) + const { categories, tags, postCount, latestPosts } = await getGlobalNotionData({ from, includePage: true, tagsCount: 0 }) return { props: { tags, - posts: allPosts, categories, postCount, latestPosts