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

@@ -19,7 +19,7 @@ export function getPostUrlBySlug(slug: string): string {
export function getCategoryUrl(category: string): string {
if (category === i18n(i18nKey.uncategorized))
return url("/archive/category/uncategorized/");
return url(`/archive/category/${category}/`);
return url(`/archive/category/${encodeURIComponent(category)}/`);
}
export function getDir(path: string): string {