From b05b8fb842b43f4f6462b425cb46d835579cbcfb Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Thu, 28 Dec 2023 14:16:40 +0630 Subject: [PATCH] feat: replace slugified title with unslugified tag name (#198) Update slugified titles to be unslugified in the tag page. This is for better SEO and better a11y. Url and tag elelemnts will still be slugified. Closes: #179 --- src/components/Tag.astro | 10 +++++----- src/layouts/PostDetails.astro | 2 +- src/pages/tags/[tag].astro | 13 +++++++------ src/pages/tags/index.astro | 2 +- src/utils/getUniqueTags.ts | 15 ++++++++++----- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/components/Tag.astro b/src/components/Tag.astro index bfb4ade..d4a963c 100644 --- a/src/components/Tag.astro +++ b/src/components/Tag.astro @@ -1,10 +1,10 @@ --- export interface Props { - name: string; + tag: string; size?: "sm" | "lg"; } -const { name, size = "sm" } = Astro.props; +const { tag, size = "sm" } = Astro.props; ---
  • -  {name.toLowerCase()} +  {tag}
  • diff --git a/src/layouts/PostDetails.astro b/src/layouts/PostDetails.astro index 1ec670e..24e32fe 100644 --- a/src/layouts/PostDetails.astro +++ b/src/layouts/PostDetails.astro @@ -70,7 +70,7 @@ const layoutProps = {