hexo主题 新增category、tag分页

This commit is contained in:
tangly
2022-11-12 22:05:49 +08:00
parent 53dda550b2
commit c3aebd851c
14 changed files with 242 additions and 120 deletions

View File

@@ -14,8 +14,7 @@ import BlogPostListEmpty from './BlogPostListEmpty'
const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
const showPagination = postCount >= BLOG.POSTS_PER_PAGE
if (!posts || posts.length === 0) {
if (!posts || posts.length === 0 || page > totalPage) {
return <BlogPostListEmpty />
} else {
return (