From e8bd3911b319cc8f6d573acbcd5bce8a997035c9 Mon Sep 17 00:00:00 2001 From: satnaing Date: Mon, 15 May 2023 10:05:11 +0630 Subject: [PATCH] refactor: update slugify logic inside the component itself --- src/layouts/PostDetails.astro | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/layouts/PostDetails.astro b/src/layouts/PostDetails.astro index e1d8971..9a63df0 100644 --- a/src/layouts/PostDetails.astro +++ b/src/layouts/PostDetails.astro @@ -13,8 +13,7 @@ export interface Props { const { post } = Astro.props; -let { title, author, description, ogImage, pubDatetime, tags } = post.data; -tags = tags.map(tag => slugifyStr(tag)); +const { title, author, description, ogImage, pubDatetime, tags } = post.data; const { Content } = await post.render(); @@ -44,7 +43,7 @@ const ogUrl = new URL(ogImage ? ogImage : `${title}.png`, Astro.url.origin)