(fix) generate international docs routes

This commit is contained in:
kakkokari-gtyih 2023-11-18 19:01:57 +09:00
parent 29362ff75e
commit 9afe425203

View File

@ -52,16 +52,10 @@ definePageMeta({
layout: 'docs',
});
defineI18nRoute({
//locales: (locales.value as LocaleObject[]).map((e) => e.code),
//
locales: ['ja'],
});
const route = useRoute();
const slugs = (route.params.slug as string[]).filter((v) => v !== '');
const { data } = await useAsyncData(`blog-${locale.value}-${slugs.join('-')}`, () => queryContent(`/${locale.value}/docs/${slugs.join('/')}`).findOne());
const { data } = await useAsyncData(`docs-${locale.value}-${slugs.join('-')}`, () => queryContent(`/${locale.value}/docs/${slugs.join('/')}`).findOne());
if (!data.value) {
throw createError({ statusCode: 404, statusMessage: 'page not found' });