This commit is contained in:
tangly1024.com
2023-11-06 16:28:01 +08:00
parent ecf7825dad
commit a0b481eaca
137 changed files with 326 additions and 383 deletions

View File

@@ -1,6 +1,6 @@
import ProductCard from './ProductCard'
import PaginationNumber from './PaginationNumber'
import BLOG from '@/blog.config'
import { siteConfig } from '@/lib/config'
import BlogPostListEmpty from './BlogPostListEmpty'
/**
@@ -12,8 +12,8 @@ import BlogPostListEmpty from './BlogPostListEmpty'
* @constructor
*/
const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
const showPagination = postCount >= BLOG.POSTS_PER_PAGE
const totalPage = Math.ceil(postCount / parseInt(siteConfig('POSTS_PER_PAGE')))
const showPagination = postCount >= parseInt(siteConfig('POSTS_PER_PAGE'))
if (!posts || posts.length === 0 || page > totalPage) {
return <BlogPostListEmpty />
} else {