summaryrefslogtreecommitdiff
path: root/src/pages/blog/keywords/index.astro
blob: 255fbf481bc68a15861bec1756d2a6b52be6c51a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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>