feat(05): i18n strategy prefix — /fr/blog and /en/blog explicit routes, update collection prefixes
This commit is contained in:
@@ -5,8 +5,8 @@ const route = useRoute()
|
||||
const slug = Array.isArray(route.params.slug) ? route.params.slug.join('/') : route.params.slug
|
||||
const isFr = locale.value === 'fr'
|
||||
const collection = isFr ? 'blog_fr' : 'blog_en'
|
||||
// blog_fr prefix = /blog, blog_en prefix = /en/blog (aligned with content.config.ts)
|
||||
const path = isFr ? `/blog/${slug}` : `/en/blog/${slug}`
|
||||
// blog_fr prefix = /fr/blog, blog_en prefix = /en/blog (aligned with content.config.ts)
|
||||
const path = isFr ? `/fr/blog/${slug}` : `/en/blog/${slug}`
|
||||
|
||||
const { data: page } = await useAsyncData(`blog-${locale.value}-${slug}`, () =>
|
||||
queryCollection(collection).path(path).first()
|
||||
|
||||
Reference in New Issue
Block a user