-
-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling dynamic routes with nuxt generate #21
Comments
Hi @papertokyo ! Thanks! |
Hmm okay, I'll take a closer look and see if perhaps I'm doing something weird that would generate a blank path name. Netlify seems to be okay with the folders, so getting it working without subfolders is a 'nice to have', along with localising urls. So just to clarify, the routes config object in nuxt-i18n is only for localising the slugs of folders in the pages tree, and when creating a routes array for generate, I should reference that config? |
Yes I think so. The routes option of generate lets you specify paths. It means that Nuxt will try to find a page that matches the route in order to generate the related HTML file. This module only works with pages because it creates multiple localized routes from a single page. Now, if you want to enable localization with generate.routes, how would you provide a different payload for each language? It would mean multiple locales x content? |
I tried implementing generation of dynamic routes defined in If you don't need customized URLs per language, then maybe this alternative module works for you: https://github.com/njam/nuxt-i18n-module |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Has any progress been made to this issue? |
+1 to @CodyBontecou 's question |
Firstly a huge thanks for making this module. It's exactly what I was looking for and was hoping I wouldn't have to create.
Is there a recommended way to handle localised, dynamic route generation?
Currently I'm getting route slugs as per the generate docs, then going over the locales and adding prefixes to all the routes. This feels hacky, and I suspect I'm doing it the 'wrong' way since the module already includes a routes config feature, but I couldn't see an obvious way to hook into this.
All the routes get generated properly, except the index page for non-default locales gets output with no filename. It ends up in the right place, but named '.html'. This is only when generate.subFolders is set to false.
The text was updated successfully, but these errors were encountered: