summaryrefslogtreecommitdiff
path: root/src/components/Keywords.astro
diff options
context:
space:
mode:
authorJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-06-24 12:08:41 -0300
committerJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-06-24 12:50:43 -0300
commitf9a77c5c27aede4e5978eb55d9b7af781b680a1d (patch)
treed545e325ba1ae756fc2eac66fac1001b6753c40d /src/components/Keywords.astro
feat!: initial commit
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
Diffstat (limited to 'src/components/Keywords.astro')
-rw-r--r--src/components/Keywords.astro52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/components/Keywords.astro b/src/components/Keywords.astro
new file mode 100644
index 0000000..1800d5a
--- /dev/null
+++ b/src/components/Keywords.astro
@@ -0,0 +1,52 @@
+---
+import type { CollectionEntry } from "astro:content";
+
+interface Props {
+ keywords: CollectionEntry<"blog">["data"]["keywords"];
+}
+
+const { keywords } = Astro.props;
+---
+<aside>
+ <ul>
+ {
+ keywords.map((x) => (
+ <li>
+ <a rel="tag" itemprop="keywords" href={`/blog/keywords/${x}`}><b>{
+ x
+ }</b></a>
+ </li>
+ ))
+ }
+ </ul>
+</aside>
+
+<style>
+ ul {
+ list-style-type: none;
+ padding-inline-start: 0;
+ max-width: 40ch;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: 1em;
+ margin-inline: auto;
+ }
+
+ ul > li {
+ font-size: smaller;
+ display: inline-block;
+ }
+
+ ul > li::before {
+ content: "#";
+ color: var(--color-active);
+ font-weight: bolder;
+ }
+
+ @media print {
+ aside {
+ display: none;
+ }
+ }
+</style>