Skip to content
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

Add one more way to define custom routes. 'named-config' #2407

Open
3 of 4 tasks
tirojal opened this issue Sep 13, 2023 · 2 comments · May be fixed by #2408
Open
3 of 4 tasks

Add one more way to define custom routes. 'named-config' #2407

tirojal opened this issue Sep 13, 2023 · 2 comments · May be fixed by #2408

Comments

@tirojal
Copy link

tirojal commented Sep 13, 2023

Describe the feature

I have a project that heavily relies on several modules injecting pages. It is used to create websites for different countries by feeding country-config into nuxt-config. As a result, each module may inject a different set of pages based on the configuration.

Currently, I have found no way to define custom routes for pages injected through modules.
I cannot use customRoutes: 'page' because it would require modifying all modules whenever we release the website for a new country.
Also, I cannot use customRoutes: 'config' since it cannot resolve AnalyzedNuxtPageMeta for injected pages.

I wrote some details in discussions few days ago:
#2398

I'd like to have an ability to define customRoutes based on route name instead of fs-like path.
So next 2 blocks will give same result:

i18n: {
  customRoutes: 'config',
  pages: {
    'my/[param]/page': {
      en: 'my/[param]/page',
      de: 'mein/[param]/seite'
    }
  }
}
i18n: {
  customRoutes: 'named-config',
  pages: {
    'my-param-page': { 
      en: 'my/:param()/page',
      de: 'mein/:param()/seite'
    }
  }
}

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

tirojal pushed a commit to tirojal/i18n that referenced this issue Sep 13, 2023
@tirojal tirojal linked a pull request Sep 13, 2023 that will close this issue
7 tasks
@kazupon
Copy link
Collaborator

kazupon commented Sep 14, 2023

Thank you for your reporting!

I've just put the my opinion for your proposal.
#2398 (comment)

@lateek35
Copy link

Also having issue to use custom routes for pages injected trough module. Is there any workaround ATM ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants