mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-23 10:41:31 +08:00
feat: 允许tags不存在
This commit is contained in:
@ -16,7 +16,7 @@ export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
|
||||
const uniqueTags = getUniqueTags(allPostsByDate)
|
||||
|
||||
return uniqueTags.flatMap((tag) => {
|
||||
const filterPosts = allPostsByDate.filter((post) => post.data.tags.includes(tag))
|
||||
const filterPosts = allPostsByDate.filter((post) => post.data.tags?.includes(tag))
|
||||
return paginate(filterPosts, {
|
||||
pageSize: 50,
|
||||
params: { tag }
|
||||
|
Reference in New Issue
Block a user