fix(修复tags为空时foreach报错的问题)

Closes #3322
Closes #3038
Closes #3137
This commit is contained in:
anime
2025-04-12 01:13:45 +08:00
parent 4ee9656c8a
commit ab1fbe1d6f

View File

@@ -28,7 +28,7 @@ export function getAllTags({
const AllTagInfos = {}
// 遍历所有文章
allPosts.forEach(post => {
post.tags.forEach(tag => {
post.tags?.forEach(tag => {
// 如果标签已经存在
if (AllTagInfos[tag]) {
if (