From 7795979ebc2e192d48e88f05369bbba77f7413f7 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 2 Apr 2022 12:31:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E9=94=81=EF=BC=9A=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E6=96=87=E7=AB=A0=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index.js | 3 +++ pages/page/[page].js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pages/index.js b/pages/index.js index bfbda4dd..96778eea 100644 --- a/pages/index.js +++ b/pages/index.js @@ -32,6 +32,9 @@ export async function getStaticProps () { if (BLOG.POST_LIST_PREVIEW === 'true') { for (const i in postsToShow) { const post = postsToShow[i] + if (post.password && post.password !== '') { + continue + } const blockMap = await getPostBlocks(post.id, 'slug', BLOG.POST_PREVIEW_LINES) if (blockMap) { post.blockMap = blockMap diff --git a/pages/page/[page].js b/pages/page/[page].js index 00ef030b..4561b8c6 100644 --- a/pages/page/[page].js +++ b/pages/page/[page].js @@ -42,6 +42,9 @@ export async function getStaticProps ({ params: { page } }) { if (BLOG.POST_LIST_PREVIEW === 'true') { for (const i in props.posts) { const post = props.posts[i] + if (post.password && post.password !== '') { + continue + } const blockMap = await getPostBlocks(post.id, 'slug', BLOG.POST_PREVIEW_LINES) if (blockMap) { post.blockMap = blockMap