From 75a9ea5fce7642a6b37d1c28c480ceb4d9fecfb1 Mon Sep 17 00:00:00 2001 From: dealjus Date: Sun, 27 Apr 2025 00:28:34 -0700 Subject: [PATCH] Move tags to correct place --- src/pages/blog/index.astro | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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}

-