mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
Filter draft posts when calculating total pages
This commit is contained in:
@@ -54,7 +54,7 @@ const posts = await Astro.glob<Frontmatter>("../../contents/*.md");
|
|||||||
|
|
||||||
const sortedPosts = getSortedPosts(posts);
|
const sortedPosts = getSortedPosts(posts);
|
||||||
|
|
||||||
const totalPages = getPageNumbers(posts.length);
|
const totalPages = getPageNumbers(sortedPosts.length);
|
||||||
|
|
||||||
const currentPage =
|
const currentPage =
|
||||||
slug && !isNaN(Number(slug)) && totalPages.includes(Number(slug))
|
slug && !isNaN(Number(slug)) && totalPages.includes(Number(slug))
|
||||||
|
|||||||
Reference in New Issue
Block a user