fix: render paginate only if more than 1 page
This commit is contained in:
parent
88096a536b
commit
2e5a3a5a9a
@ -86,9 +86,11 @@ export default function ListLayout({ posts, title, initialDisplayPosts = [], pag
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
{pagination && !searchValue && (
|
||||
<Pagination currentPage={pagination.currentPage} totalPages={pagination.totalPages} />
|
||||
)}
|
||||
{pagination &&
|
||||
pagination.totalPages > 1 &&
|
||||
!searchValue(
|
||||
<Pagination currentPage={pagination.currentPage} totalPages={pagination.totalPages} />
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import siteMetadata from '@/data/siteMetadata'
|
||||
import ListLayout from '@/layouts/ListLayout'
|
||||
import { PageSeo } from '@/components/SEO'
|
||||
|
||||
export const POSTS_PER_PAGE = 5
|
||||
export const POSTS_PER_PAGE = 10
|
||||
|
||||
export async function getStaticProps() {
|
||||
const posts = await getAllFilesFrontMatter('blog')
|
||||
|
Loading…
x
Reference in New Issue
Block a user