修复部分NOTION_CONFIG读取问题

This commit is contained in:
tangly1024.com
2024-05-15 14:55:14 +08:00
parent 70e53649b3
commit 517a967640
44 changed files with 911 additions and 565 deletions

View File

@@ -1,7 +1,8 @@
import BlogPostCard from './BlogPostCard'
import PaginationNumber from './PaginationNumber'
import BlogPostListEmpty from './BlogPostListEmpty'
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import BlogPostCard from './BlogPostCard'
import BlogPostListEmpty from './BlogPostListEmpty'
import PaginationNumber from './PaginationNumber'
/**
* 文章列表分页表格
@@ -12,7 +13,9 @@ import { siteConfig } from '@/lib/config'
* @constructor
*/
const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
const totalPage = Math.ceil(postCount / parseInt(siteConfig('POSTS_PER_PAGE')))
const { NOTION_CONFIG } = useGlobal()
const POSTS_PER_PAGE = siteConfig('POSTS_PER_PAGE', 12, NOTION_CONFIG)
const totalPage = Math.ceil(postCount / POSTS_PER_PAGE)
if (!posts || posts.length === 0) {
return <BlogPostListEmpty />
@@ -20,7 +23,9 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
return (
<div>
{/* 文章列表 */}
<div id="posts-wrapper" className="flex flex-wrap lg:space-y-4 space-y-1">
<div
id='posts-wrapper'
className='flex flex-wrap lg:space-y-4 space-y-1'>
{posts?.map((post, index) => (
<BlogPostCard key={post.id} index={index} post={post} />
))}