---
import { getCollection} from "astro:content";
import { getPosts } from "../../utils";
import Layout from "../../layouts/Layout.astro";
import HomeButton from "../../components/HomeButton.astro";
const tags = await getCollection("tags");
const posts = await getPosts("posts");
// Get post count for reach tag
tags.forEach((tag) => {
tag.data.postCount = posts.filter((project) => {
return project.data.tags.includes(tag.slug);
}).length;
})
// Dunno if Astro auto-sorts stuff
tags.sort((a, b) => {
return a.data.name.localeCompare(b.data.name);
});
---