aboutsummaryrefslogtreecommitdiff
path: root/src/layouts
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-02-05 21:16:42 -0500
committerAndrew Lee <alee14498@protonmail.com>2024-02-05 21:24:35 -0500
commitbf7ebfa81791703959015c9b1b8ddbc4edae5ee3 (patch)
tree730e9eb3cc0843e93a2e02007f1f9f63f32df8c8 /src/layouts
parent0fed60dc83db376ddb3f7c835894db29dfe51994 (diff)
downloadpersonal-website-bf7ebfa81791703959015c9b1b8ddbc4edae5ee3.tar.gz
personal-website-bf7ebfa81791703959015c9b1b8ddbc4edae5ee3.tar.bz2
personal-website-bf7ebfa81791703959015c9b1b8ddbc4edae5ee3.zip
Tags in blog post
Diffstat (limited to 'src/layouts')
-rw-r--r--src/layouts/BlogPost.astro19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/layouts/BlogPost.astro b/src/layouts/BlogPost.astro
index a97dadf..628215f 100644
--- a/src/layouts/BlogPost.astro
+++ b/src/layouts/BlogPost.astro
@@ -1,14 +1,17 @@
---
import Layout from './Default.astro';
-const { title, description, pubDate } = Astro.props;
-import { getCollection } from "astro:content";
-const postTags = (await getCollection('blog'));
+const { title, description, pubDate, tags } = Astro.props;
---
<Layout title=`${title} - Andrew Lee` description={description}>
<header>
<h1 class="header-text">{title}</h1>
- <small>{pubDate}</small>
+ <span>{pubDate}</span>
+ <div class="tags">
+ {tags.map(tag => (
+ <span class="tag"><a href={`/blog/tags/${tag}`}>{tag}</a></span>
+ ))}
+ </div>
</header>
<div class="container">
<main>
@@ -42,11 +45,17 @@ const postTags = (await getCollection('blog'));
font-size: 1.5em;
font-weight: 300;
}
-
.container {
margin: 1em 10em 1em 10em;
}
+ .tags {
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ gap: 1em;
+ }
+
@media (max-width: 992px) {
.container {
margin: 10px 20px 10px 20px;