From 87da9c0dbfcf5a80efd40de6e6c16e0f10c8158f Mon Sep 17 00:00:00 2001 From: xloong Date: Mon, 12 Dec 2022 14:44:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BB=85=E6=96=87=E7=AB=A0=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=B8=BAPublished=E7=9A=84=EF=BC=8C=E8=AE=A1=E7=AE=97?= =?UTF-8?q?category=E4=B8=8Etags=E8=AE=A1=E6=95=B0=EF=BC=8CInvisible?= =?UTF-8?q?=E7=9A=84=E6=96=87=E7=AB=A0=E4=B8=8D=E5=8F=82=E4=B8=8E=E8=AE=A1?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getAllCategories.js | 2 +- lib/notion/getAllTags.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/notion/getAllCategories.js b/lib/notion/getAllCategories.js index 2225b965..b7700bc1 100644 --- a/lib/notion/getAllCategories.js +++ b/lib/notion/getAllCategories.js @@ -14,7 +14,7 @@ import { isIterable } from '../utils' * @returns {Promise<{}|*[]>} */ export function getAllCategories({ allPages, categoryOptions, sliceCount = 0 }) { - const allPosts = allPages.filter(page => page.type === 'Post') + const allPosts = allPages.filter(page => page.type === 'Post' && page.status === 'Published') if (!allPosts || !categoryOptions) { return [] } diff --git a/lib/notion/getAllTags.js b/lib/notion/getAllTags.js index 098f62fb..b9144be8 100644 --- a/lib/notion/getAllTags.js +++ b/lib/notion/getAllTags.js @@ -8,7 +8,7 @@ import { isIterable } from '../utils' * @returns {Promise<{}|*[]>} */ export function getAllTags({ allPages, sliceCount = 0, tagOptions }) { - const allPosts = allPages.filter(page => page.type === 'Post') + const allPosts = allPages.filter(page => page.type === 'Post' && page.status === 'Published') if (!allPosts || !tagOptions) { return []