[go: nahoru, domu]

Skip to content

Commit

Permalink
fix 仅文章状态为Published的,计算category与tags计数,Invisible的文章不参与计数
Browse files Browse the repository at this point in the history
  • Loading branch information
xloong committed Dec 12, 2022
1 parent 01bca8a commit 87da9c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/notion/getAllCategories.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
}
Expand Down
2 changes: 1 addition & 1 deletion lib/notion/getAllTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down

0 comments on commit 87da9c0

Please sign in to comment.