mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
feature: 优化页面体积
This commit is contained in:
@@ -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 <Custom404 />
|
||||
}
|
||||
@@ -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}
|
||||
>
|
||||
<ArticleDetail post={post} blockMap={blockMap} allPosts={allPosts} prev={prev} next={next} />
|
||||
<ArticleDetail post={post} blockMap={blockMap} prev={prev} next={next} />
|
||||
</BaseLayout>
|
||||
)
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
>
|
||||
<ArticleDetail
|
||||
@@ -95,7 +93,6 @@ export async function getStaticProps ({ params: { slug } }) {
|
||||
tags,
|
||||
prev,
|
||||
next,
|
||||
allPosts,
|
||||
recommendPosts,
|
||||
categories,
|
||||
postCount,
|
||||
|
||||
@@ -25,7 +25,7 @@ export async function getStaticProps () {
|
||||
}
|
||||
}
|
||||
|
||||
const Search = ({ posts, tags, categories, postCount, latestPosts }) => {
|
||||
const Search = ({ posts, tags, categories, postCount }) => {
|
||||
let filteredPosts = []
|
||||
const searchKey = getSearchKey()
|
||||
if (searchKey) {
|
||||
|
||||
@@ -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 <BaseLayout meta={meta} categories={categories} totalPosts={allPosts} postCount={postCount} latestPosts={latestPosts}>
|
||||
return <BaseLayout meta={meta} categories={categories} postCount={postCount} latestPosts={latestPosts}>
|
||||
<div className='bg-white dark:bg-gray-700 px-10 py-10 shadow'>
|
||||
<div className='dark:text-gray-200 mb-5'><FontAwesomeIcon icon={faTags} className='mr-4'/>{locale.COMMON.TAGS}:</div>
|
||||
<div id='tags-list' className='duration-200 flex flex-wrap'>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user