From 755576fbc5b4295be0cb066ce300e3d6b9645d6c Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Thu, 22 Sep 2022 23:44:21 +0630 Subject: [PATCH] Filter draft posts when calculating total pages --- src/pages/posts/[slug].astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro index 63ff0fe..60c3d9a 100644 --- a/src/pages/posts/[slug].astro +++ b/src/pages/posts/[slug].astro @@ -54,7 +54,7 @@ const posts = await Astro.glob("../../contents/*.md"); const sortedPosts = getSortedPosts(posts); -const totalPages = getPageNumbers(posts.length); +const totalPages = getPageNumbers(sortedPosts.length); const currentPage = slug && !isNaN(Number(slug)) && totalPages.includes(Number(slug))