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:
committed by
GitHub
parent
3194dfc521
commit
11535a9709
@@ -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)}>
|
||||
|
||||
Reference in New Issue
Block a user