summaryrefslogtreecommitdiff
path: root/src/pages/blog/keywords/index.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/blog/keywords/index.astro')
-rw-r--r--src/pages/blog/keywords/index.astro21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pages/blog/keywords/index.astro b/src/pages/blog/keywords/index.astro
new file mode 100644
index 0000000..255fbf4
--- /dev/null
+++ b/src/pages/blog/keywords/index.astro
@@ -0,0 +1,21 @@
+---
+import { getCollection } from "astro:content";
+import Base from "@layouts/Base.astro";
+
+const title = "Keywords";
+const description = "Keywords";
+
+const blogs = await getCollection("blog");
+let keywords = [
+ ...new Set([
+ ...blogs.flatMap(({ data }) => [...(data.keywords ?? [])]),
+ ]),
+];
+---
+
+<Base {title} {description} {keywords}>
+ <h1>Keywords</h1>
+ <ul>
+ {keywords.map((k) => <li><a href={`/blog/keywords/${k}`}>{k}</a></li>)}
+ </ul>
+</Base>