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 []