---
import Layout from '../layouts/Default.astro';
import { getAllTags, getSettings, invariant } from "@matthiesenxyz/astro-ghostcms/api";
import TagSummaryCard from '../components/generic/TagSummaryCard.astro';
const { tags } = await getAllTags();
const settings = await getSettings();
invariant(settings, 'Settings not found');
const title = settings.title;
const description = settings.description;

---

<Layout
  title='Tags'
  pageTitle=`${title} | Tags`
  description={description}
>
  <main class='bg-pink p-6'>
    { 
      tags
        .filter((tag) => tag.slug && !tag.slug.startsWith("hash-"))
        .map((tag) => (
            <TagSummaryCard tag={tag}, settings={settings} />
            <br />
        ))
    }
  </main>
</Layout>
