nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.12k stars 623 forks source link

Routes not generated with Nuxt i18n with strategy: 'prefix_and_default'. #778

Open daishizenSensei opened 3 years ago

daishizenSensei commented 3 years ago

Hi everyone,

It seems there is an issue with Nuxt Content combined with Nuxt i18n with strategy: 'prefix_and_default'. In fact, all route with no local are not generated.

Here is my generate config :

  generate: {
    async routes () {
      const { $content } = require('@nuxt/content')
      const files = await $content({ deep: true }).where({ slug: { $ne: 'type' } }).only(['path']).fetch()
      return files.map(file => file.path === '/index' ? '/' : file.path)
    },

How can we deal with it? Thank you, Kevin

atinux commented 3 years ago

Having a Sandbox with a reproduction is recommend for such use case.

Fork https://codesandbox.io/s/nuxt-content-playground-l164h?from-embed

daishizenSensei commented 3 years ago

But you can simulate a generate with sandbox?

karzol73 commented 3 years ago

Hi Kevin!

I have the same issue. Have you been able to find a solution in the meantime?

daishizenSensei commented 3 years ago

Hi!

Nope, i use now prefix strategy...

karzol73 commented 3 years ago

Thank you!