mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 23:16:52 +00:00
修复部分NOTION_CONFIG读取问题
This commit is contained in:
@@ -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} />
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user