Add localized paths

This commit is contained in:
Sakura Knoll
2022-01-03 14:06:15 +09:00 Unverified
parent 8bc576208a
commit 167d8e6623
6 changed files with 54 additions and 31 deletions
+8 -6
View File
@@ -5,7 +5,7 @@ import SquareImageBox from '../../../components/atoms/SquareImageBox'
import Breadcrumb from '../../../components/organisms/Breadcrumb'
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
import { WeaponData } from '../../../lib/honkai3rd/weapons'
import { getI18NProps } from '../../../lib/i18n'
import { generateI18NPaths, getI18NProps } from '../../../lib/i18n'
import { capitalize } from '../../../lib/string'
import {
getWeaponById,
@@ -94,11 +94,13 @@ export async function getStaticProps({
export async function getStaticPaths() {
return {
paths: listWeapons().map((weapon) => {
return {
params: { weaponId: weapon.id },
}
}),
paths: generateI18NPaths(
listWeapons().map((weapon) => {
return {
params: { weaponId: weapon.id },
}
})
),
fallback: false,
}
}