feat(05): i18n strategy prefix — /fr/blog and /en/blog explicit routes, update collection prefixes

This commit is contained in:
2026-04-21 16:49:32 +02:00
parent 2b8aa6d377
commit c6320760fb
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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()