Fix category with reserved character (#431)
Some checks failed
Code quality / quality (push) Failing after 3s
Build and Check / Astro Check for Node.js 22 (push) Failing after 4s
Build and Check / Astro Check for Node.js 23 (push) Failing after 5s
Build and Check / Astro Build for Node.js 22 (push) Failing after 4s
Build and Check / Astro Build for Node.js 23 (push) Failing after 4s

* fix: Encode category in URLs to handle reserved characters

* fix: Encode category names in static paths to handle reserved characters
This commit is contained in:
Katsuyuki Karasawa
2025-05-01 02:24:53 +09:00
committed by GitHub
parent 3194dfc521
commit 11535a9709
3 changed files with 4 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ const className = Astro.props.class;
<Icon name="material-symbols:book-2-outline-rounded" class="text-xl"></Icon>
</div>
<div class="flex flex-row flex-nowrap items-center">
<a href={url(`/archive/category/${category || 'uncategorized'}/`)} aria-label=`View all posts in the ${category} category`
<a href={url(`/archive/category/${encodeURIComponent(category || 'uncategorized')}/`)} aria-label=`View all posts in the ${category} category`
class="link-lg transition text-50 text-sm font-medium
hover:text-[var(--primary)] dark:hover:text-[var(--primary)] whitespace-nowrap">
{category || i18n(I18nKey.uncategorized)}