diff --git a/src/pages/tags/index.astro b/src/pages/tags/index.astro index 54e75a7..9d41e27 100644 --- a/src/pages/tags/index.astro +++ b/src/pages/tags/index.astro @@ -6,7 +6,8 @@ const posts = await getCollection("blog"); const tagsMap = new Map(); posts.forEach((post) => { post.data.tags?.forEach((tag) => { - tagsMap.set(tag, (tagsMap.get(tag) || 0) + 1); + const currentCount = tagsMap.get(tag) || 0; + tagsMap.set(tag, currentCount + 1); }); }); const tags = Array.from(tagsMap.entries()).sort((a, b) =>