fix: 修复未分类的筛选

This commit is contained in:
KazooTTT
2025-02-24 13:38:26 +08:00
parent b3004795f0
commit 50d4e72216

View File

@ -13,7 +13,9 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
const uniqueCategories = getUniqueCategories(sortedPosts);
return uniqueCategories.flatMap((category) => {
const filterPosts = sortedPosts.filter((post) => post.data.category === category);
const filterPosts = sortedPosts.filter((post) =>
category === "未分类" ? !post.data.category : post.data.category === category
);
return paginate(filterPosts, {
pageSize: 20,
params: { category },