Skip to content

Commit

Permalink
Merge pull request danielcgilibert#86 from Seventeezz/fix/speical-cha…
Browse files Browse the repository at this point in the history
…r-in-tag-urls

fix: handle special characters in tag URLs
  • Loading branch information
danielcgilibert authored Sep 18, 2024
2 parents a4a4e55 + 49113db commit 8185f06
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/components/Tag.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
export interface Props {
tag: string
}
const { tag } = Astro.props
---

<a href={`/tags/${tag.toLowerCase()}`} aria-label={tag}>
<span
class='bg-indigo-600 font-semibold text-white dark:bg-indigo-900 dark:text-white shadow text-sm w-fit px-2 py-1 md:px-5 md:py-2 rounded-full'
>
{tag ?? 'Blog Tag'}
</span>
</a>
---
export interface Props {
tag: string
}
const { tag } = Astro.props
---

<a href={`/tags/${encodeURIComponent(tag.toLowerCase())}`} aria-label={tag}>
<span
class='bg-indigo-600 font-semibold text-white dark:bg-indigo-900 dark:text-white shadow text-sm w-fit px-2 py-1 md:px-5 md:py-2 rounded-full'
>
{tag ?? 'Blog Tag'}
</span>
</a>

0 comments on commit 8185f06

Please sign in to comment.