Add tags page

This commit is contained in:
Sat Naing
2022-09-11 14:08:22 +06:30
parent 5632b9bcf8
commit 53936d89f8
+21
View File
@@ -0,0 +1,21 @@
---
import Header from "@components/Header.astro";
import Tag from "@components/Tag.astro";
import Layout from "@layouts/Layout.astro";
import Main from "@layouts/Main.astro";
import getUniqueTags from "src/utils/getUniqueTags";
import type { Frontmatter } from "./index.astro";
const posts = await Astro.glob<Frontmatter>("../contents/*.md");
let tags = getUniqueTags(posts);
---
<Layout title="AstroPaper: tags">
<Header activeNav="tags" />
<Main pageTitle="Tags" pageDesc="All the tags used in posts.">
<ul>
{tags.map((tag) => <Tag name={tag} size="lg" />)}
</ul>
</Main>
</Layout>