Fix category with reserved character (#431)

* 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
+2 -2
View File
@@ -10,13 +10,13 @@ export async function getStaticPaths() {
return categories.map((category) => {
return {
params: {
category: category.name,
category: encodeURIComponent(category.name),
},
};
});
}
const category = Astro.params.category as string;
const category = decodeURIComponent(Astro.params.category as string);
---
<MainGridLayout title={i18n(I18nKey.archive)} description={i18n(I18nKey.archive)}>