Move tags to correct place

This commit is contained in:
dealjus 2025-04-27 00:28:34 -07:00
parent 8111bdd318
commit 75a9ea5fce

View File

@ -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());
<link rel="canonical" href={`${GLOBAL.rootUrl}/blog`} />
</Fragment>
<Section class="my-8">
<div class="flex flex-wrap gap-2">
<div class="flex items-center gap-4 pt-8 pb-4">
<h1 class="font-display text-3xl sm:text-4xl leading-loose">{GLOBAL.articlesName}</h1>
</div>
<div class="flex flex-wrap gap-2 pb-16">
{Object.entries(tagCounts).map(([tag, count]) => (
<span class="-zag-text -zag-bg zag-transition px-2 py-1 text-sm font-semibold">
{tag}: {count}
</span>
))}
</div>
</Section>
<Section class="my-8">
<div class="flex items-center gap-4 pt-8 pb-16">
<h1 class="font-display text-3xl sm:text-4xl leading-loose">{GLOBAL.articlesName}</h1>
</div>
<ul>
{
articles.map((project) => (