所有标签页数量修复
This commit is contained in:
tangly1024
2021-12-01 12:47:17 +08:00
parent 598079869f
commit 633d83beb5
2 changed files with 14 additions and 11 deletions

View File

@@ -30,7 +30,7 @@ export async function getAllTags ({ allPosts, sliceCount = 12, tagOptions }) {
return { name: tag, count: tagObj[tag], color }
})
list.sort((a, b) => b.count - a.count)
if (sliceCount) {
if (sliceCount && sliceCount > 0) {
return list.slice(0, 12)
} else {
return list