From bf7ebfa81791703959015c9b1b8ddbc4edae5ee3 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 5 Feb 2024 21:16:42 -0500 Subject: Tags in blog post --- src/layouts/BlogPost.astro | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/layouts') 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; ---

{title}

- {pubDate} + {pubDate} +
+ {tags.map(tag => ( + {tag} + ))} +
@@ -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; -- cgit v1.2.3