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
This commit is contained in:
Sat Naing
2023-12-28 14:16:40 +06:30
committed by GitHub
parent 2827d4e7d8
commit b05b8fb842
5 changed files with 24 additions and 18 deletions
+5 -5
View File
@@ -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;
---
<li
@@ -13,8 +13,8 @@ const { name, size = "sm" } = Astro.props;
}`}
>
<a
href={`/tags/${name.toLowerCase()}`}
transition:name={name.toLowerCase()}
href={`/tags/${tag}`}
transition:name={tag}
class={`${size === "sm" ? "text-sm" : "text-lg"} pr-2 group`}
>
<svg
@@ -24,7 +24,7 @@ const { name, size = "sm" } = Astro.props;
d="M16.018 3.815 15.232 8h-4.966l.716-3.815-1.964-.37L8.232 8H4v2h3.857l-.751 4H3v2h3.731l-.714 3.805 1.965.369L8.766 16h4.966l-.714 3.805 1.965.369.783-4.174H20v-2h-3.859l.751-4H21V8h-3.733l.716-3.815-1.965-.37zM14.106 14H9.141l.751-4h4.966l-.752 4z"
></path>
</svg>
&nbsp;<span>{name.toLowerCase()}</span>
&nbsp;<span>{tag}</span>
</a>
</li>