Replies: 1 comment 1 reply
-
Thank you for your proposal! For your idea, I have the following opinion: custom route path syntaxWe should use nuxt file system path syntax than vue router path. How to define a custom route path for a route (page) inserted from the outsideThere are many ways to do this, but I think passing meta-information via The meta-information to be passed should be in the same format as nuxt.config. Because there is no cognitive load on how to configure it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found no way to define custom path for page injected in module with
customRoutes: 'config'
I cannot use
customRotes: 'page'
since some modules is not opinionated to be used with i18n.And I have multiple instances of project for different countries, and I want to maintain just one file per country to define customRoutes. Or even externalize the maintenance and import and apply pages-config from DB during build.
I working on implementation in my fork and I have several ideas how I can achieve it:
customRoutes
option:names
(working title)Will behave similar to
config
. But will useroute.name
as key and expects to get resolved paths.pages.ts/analyzeNuxtPages
for injected routes based on route pathit will allow to use regular `customRoutes: 'config'
but I dont like that the route will be processed and transformed back and forth:
vueRouterPath -> nuxtFsLikePath -> vueRouterPath
So there will be ability to add another module that will process all pages and append i18n to route.
Basically it's a hybrid of (2) and (3) but requires some knowledge about i18n-module internals.
Conclusion
I think the final solution should implement not only one but several ways to achieve routes custom paths. Not sure yet about their priority. Would like to read your thoughts. Thanks
Beta Was this translation helpful? Give feedback.
All reactions