From 502cecc005512431f607072fc62174847f45273b Mon Sep 17 00:00:00 2001 From: prototypa Date: Tue, 7 May 2024 23:45:50 -0400 Subject: [PATCH] Better links in Post Items --- src/components/blog/GridItem.astro | 43 +++++++++++++++++++----------- src/components/blog/ListItem.astro | 30 +++++++++++++++++---- 2 files changed, 53 insertions(+), 20 deletions(-) diff --git a/src/components/blog/GridItem.astro b/src/components/blog/GridItem.astro index e1e99b1..cf7ed14 100644 --- a/src/components/blog/GridItem.astro +++ b/src/components/blog/GridItem.astro @@ -13,13 +13,30 @@ export interface Props { const { post } = Astro.props; const image = await findImage(post.image); + +const link = APP_BLOG?.post?.isEnabled ? getPermalink(post.permalink, 'post') : ''; ---
{ - image && ( - + image && + (link ? ( + + {post.title} + + ) : ( - - ) + )) }
- + +

{ - !APP_BLOG?.post?.isEnabled ? ( - post.title - ) : ( - -

+ link ? ( + {post.title} -

+ ) : ( + post.title ) } - +

+

{post.excerpt}

diff --git a/src/components/blog/ListItem.astro b/src/components/blog/ListItem.astro index db4dac5..3fef240 100644 --- a/src/components/blog/ListItem.astro +++ b/src/components/blog/ListItem.astro @@ -23,8 +23,26 @@ const link = APP_BLOG?.post?.isEnabled ? getPermalink(post.permalink, 'post') :
{ - image && ( - + image && + (link ? ( + + + + ) : ( - - ) + )) }
@@ -74,7 +91,10 @@ const link = APP_BLOG?.post?.isEnabled ? getPermalink(post.permalink, 'post') :

{ link ? ( - + {post.title} ) : (