From 65de4fadd7eb79fe5ea926fd62cae07966e15166 Mon Sep 17 00:00:00 2001 From: Theodore Kruczek Date: Sun, 14 Jan 2024 18:49:32 -0500 Subject: [PATCH] feat: add text to blog post if author is set Fixes #341 --- src/components/blog/ListItem.astro | 8 ++++++++ src/components/blog/SinglePost.astro | 10 ++++++++++ .../get-started-website-with-astro-tailwind-css.md | 1 + 3 files changed, 19 insertions(+) diff --git a/src/components/blog/ListItem.astro b/src/components/blog/ListItem.astro index 18c2b1c..c4f6c7c 100644 --- a/src/components/blog/ListItem.astro +++ b/src/components/blog/ListItem.astro @@ -60,6 +60,14 @@ const link = APP_BLOG?.post?.isEnabled ? getPermalink(post.permalink, 'post') : ) } + { + post.author && ( + <> + {' '} + · {post.author.replaceAll('-', ' ')} + + ) + }

diff --git a/src/components/blog/SinglePost.astro b/src/components/blog/SinglePost.astro index 6744720..a2169c1 100644 --- a/src/components/blog/SinglePost.astro +++ b/src/components/blog/SinglePost.astro @@ -40,6 +40,16 @@ const { Content } = post; {post.readingTime && <> · {post.readingTime} min read}

+ { + post.author && ( +
+

+ + {post.author} +

+
+ ) + }

diff --git a/src/content/post/get-started-website-with-astro-tailwind-css.md b/src/content/post/get-started-website-with-astro-tailwind-css.md index 0602021..2c88722 100644 --- a/src/content/post/get-started-website-with-astro-tailwind-css.md +++ b/src/content/post/get-started-website-with-astro-tailwind-css.md @@ -1,5 +1,6 @@ --- publishDate: 2023-08-12T00:00:00Z +author: John Smith title: Get started with AstroWind to create a website using Astro and Tailwind CSS excerpt: Start your web journey with AstroWind – harness Astro and Tailwind CSS for a stunning site. Explore our guide now. image: https://images.unsplash.com/photo-1516996087931-5ae405802f9f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80