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
@@ -8,7 +8,7 @@ import SecondaryLabel from '../../../components/atoms/SecondaryLabel'
import Breadcrumb from '../../../components/organisms/Breadcrumb'
import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator'
import { ElfData } from '../../../lib/honkai3rd/elfs'
import { getI18NProps } from '../../../lib/i18n'
import { generateI18NPaths, getI18NProps } from '../../../lib/i18n'
import { capitalize } from '../../../lib/string'
import { getElfById, listElfs } from '../../../server/data/honkai3rd/elfs'
@@ -116,11 +116,13 @@ export async function getStaticProps({
export async function getStaticPaths() {
return {
paths: listElfs().map((elf) => {
return {
params: { elfId: elf.id },
}
}),
paths: generateI18NPaths(
listElfs().map((elf) => {
return {
params: { elfId: elf.id },
}
})
),
fallback: false,
}
}