Filter draft posts when calculating total pages

This commit is contained in:
Sat Naing
2022-09-22 23:44:21 +06:30
parent 2a28fa4e32
commit 755576fbc5
+1 -1
View File
@@ -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))