From d981e29ad6c821d2ada03b139b8611bb262cf723 Mon Sep 17 00:00:00 2001 From: prototypa Date: Wed, 31 Aug 2022 17:21:30 -0400 Subject: [PATCH] Add tags component in posts --- src/components/widgets/BlogListItem.astro | 8 ++++++-- src/components/widgets/BlogPost.astro | 9 ++++++--- src/components/widgets/PostTags.astro | 12 ++++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 src/components/widgets/PostTags.astro diff --git a/src/components/widgets/BlogListItem.astro b/src/components/widgets/BlogListItem.astro index cca1f1c..5cbaa3c 100644 --- a/src/components/widgets/BlogListItem.astro +++ b/src/components/widgets/BlogListItem.astro @@ -3,6 +3,7 @@ import Picture from "~/components/core/Picture.astro"; import { getPermalink } from "~/utils/permalinks"; import { findImage } from "~/utils/findImage"; import { getFormattedDate } from "~/utils/getFormatedDate"; +import PostTags from "./PostTags.astro"; const { post } = Astro.props; @@ -19,7 +20,7 @@ const image = await findImage(post.image); - + {post.title} @@ -29,12 +30,15 @@ const image = await findImage(post.image); {post.excerpt || post.description} - \ No newline at end of file diff --git a/src/components/widgets/BlogPost.astro b/src/components/widgets/BlogPost.astro index 24a6659..ef52e85 100644 --- a/src/components/widgets/BlogPost.astro +++ b/src/components/widgets/BlogPost.astro @@ -1,6 +1,7 @@ --- import Picture from "~/components/core/Picture.astro"; import { getFormattedDate } from "~/utils/getFormatedDate"; +import PostTags from "~/components/widgets/PostTags.astro"; const { post } = Astro.props; --- @@ -12,10 +13,9 @@ const { post } = Astro.props; {getFormattedDate(post.pubDate)} ~ {Math.ceil(post.readingTime)} min read
{post.excerpt || post.description}