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

Feature request: Generated paths should follow the i18n custom route paths (config and macro) #145

Open
timothejoubert opened this issue Sep 25, 2024 · 1 comment

Comments

@timothejoubert
Copy link

Thank you for taking the time to fill out this feature request!

Description

The generated output should follow the i18n custom path set in i18n config.
https://stackblitz.com/edit/nuxt-starter-i18n-timothe-kab8ad?file=nuxt.config.ts,pages/index.vue,package.json
Would be nice to work with defineI18nRoute macro too

Input

export default defineNuxtConfig({
...
  i18n: {
    strategy: 'prefix_except_default',
    customRoutes: 'config',
    pages: {
      index: {
        fr: '/',
        en: '/home',
      },
      other: {
        fr: '/autre-page',
        en: '/other-page',
      },
    },
  },
  robots: {
    allow: ['/'],
    disallow: ['/other'],
  },

Actual output

User-agent: *
Allow: /
Allow: /en/
Disallow: /other
Disallow: /en/other

Expected output

User-agent: *
Allow: /
Allow: /en/home
Disallow: /autre-page
Disallow: /en/other-page
@harlan-zw
Copy link
Contributor

harlan-zw commented Sep 27, 2024

Hi, I agree this should be supported as the Sitemap module does support this.

PRs welcome otherwise will attempt when I have a chance.

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

No branches or pull requests

2 participants