From 7b35325c5637295b26df0ef43666f411f48d974b Mon Sep 17 00:00:00 2001 From: tangly Date: Fri, 18 Nov 2022 11:52:32 +0800 Subject: [PATCH] =?UTF-8?q?bug=EF=BC=9B=E4=BF=AE=E5=A4=8D=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=96=87=E7=AB=A0=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/[...slug].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/[...slug].js b/pages/[...slug].js index 97327526..c5181171 100644 --- a/pages/[...slug].js +++ b/pages/[...slug].js @@ -108,7 +108,7 @@ export async function getStaticProps({ params: { slug } }) { } props.post.blockMap = await getPostBlocks(props.post.id, 'slug') - const allPosts = props.allPages.filter(page => page.type === 'Post') + const allPosts = props.allPages.filter(page => page.type === 'Post' && page.status === 'Published') const index = allPosts.indexOf(props.post) props.prev = allPosts.slice(index - 1, index)[0] ?? allPosts.slice(-1)[0] props.next = allPosts.slice(index + 1, index + 2)[0] ?? allPosts[0]