diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index e756b23..139c20a 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -6,7 +6,7 @@ import Section from "../../components/common/Section.astro"; import { articles } from "../../lib/list"; import { countTags } from "../../lib/utils"; -const tagCounts = countTags(articles.map((article) => article.tags).flat()); +const tagCounts = countTags(articles.map((article) => article.tags).flat().filter((tag): tag is string => tag !== undefined)); --- @@ -36,18 +36,16 @@ const tagCounts = countTags(articles.map((article) => article.tags).flat());
-
+
+

{GLOBAL.articlesName}

+
+
{Object.entries(tagCounts).map(([tag, count]) => ( {tag}: {count} ))}
-
-
-
-

{GLOBAL.articlesName}

-