mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
Add tags page
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user