From d89047bdfa15a01d754cb9a27bbbd59fbd961337 Mon Sep 17 00:00:00 2001 From: ayoayco Date: Wed, 14 Aug 2024 19:51:32 +0200 Subject: [PATCH] refactor(blog): description logic --- src/components/blog/BaseHead.astro | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/blog/BaseHead.astro b/src/components/blog/BaseHead.astro index a5c044b..02ea55d 100644 --- a/src/components/blog/BaseHead.astro +++ b/src/components/blog/BaseHead.astro @@ -10,12 +10,17 @@ interface Props { image?: string; } -const {isArticle = false, title, description = 'default description', image = '/cozy.jpg' } = Astro.props; +let {isArticle = false, title, description = 'default description', image = '/cozy.jpg' } = Astro.props; + +description = title === SITE_TITLE + ? SITE_DESCRIPTION + : `${SITE_TITLE} • ${description}` --- + @@ -24,11 +29,7 @@ const {isArticle = false, title, description = 'default description', image = '/ -{title} • { - title === SITE_TITLE - ? SITE_DESCRIPTION - : `${SITE_TITLE} • ${description}` -} +{title} • {description}