aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/tags/index.astro
blob: 3d2c75f1d5f3ec4cdb0cf02e8f42dfb87241c57d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
import Breadcrumbs from '@/components/Breadcrumbs.astro'
import Link from '@/components/Link.astro'
import PageHead from '@/components/PageHead.astro'
import { badgeVariants } from '@/components/ui/badge'
import Layout from '@/layouts/Layout.astro'
import { getSortedTags } from '@/lib/data-utils'
import { Icon } from 'astro-icon/components'

const sortedTags = await getSortedTags()
---

<Layout class="max-w-3xl">
  <PageHead slot="head" title="Tags" />
  <Breadcrumbs items={[{ label: 'Tags', icon: 'lucide:tags' }]} />

  <div class="flex flex-col gap-4">
    <div class="flex flex-wrap gap-2">
      {
        sortedTags.map(({ tag, count }) => (
          <Link
            href={`/tags/${tag}`}
            class={badgeVariants({ variant: 'muted' })}
          >
            <Icon name="lucide:hash" class="size-3" />
            {tag}
            <span class="text-muted-foreground ml-1.5">({count})</span>
          </Link>
        ))
      }
    </div>
  </div>
</Layout>