mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-29 23:16:51 +00:00
Merge pull request #588 from xloong/dev
fix 仅文章状态为Published的,计算category与tags计数,Invisible的文章不参与计数
This commit is contained in:
@@ -14,7 +14,7 @@ import { isIterable } from '../utils'
|
|||||||
* @returns {Promise<{}|*[]>}
|
* @returns {Promise<{}|*[]>}
|
||||||
*/
|
*/
|
||||||
export function getAllCategories({ allPages, categoryOptions, sliceCount = 0 }) {
|
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) {
|
if (!allPosts || !categoryOptions) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { isIterable } from '../utils'
|
|||||||
* @returns {Promise<{}|*[]>}
|
* @returns {Promise<{}|*[]>}
|
||||||
*/
|
*/
|
||||||
export function getAllTags({ allPages, sliceCount = 0, tagOptions }) {
|
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) {
|
if (!allPosts || !tagOptions) {
|
||||||
return []
|
return []
|
||||||
|
|||||||
Reference in New Issue
Block a user