Closed altynbek07 closed 4 years ago
Hi @altynbek07,
If you set the sitemap.i18n
option at false
, it's only to not group i18n routes according this spec: https://support.google.com/webmasters/answer/189077#sitemap. I have tried and with the false
value it works fine.
Try to set at true
to understand the difference.
If you only want to hide some routes linked to a language defined from nuxt-i18n, you have to use the "exclude" option or the "filter" option of the sitemap module.
@NicoPennec Yes, I meant regular i18n routes (attached a screenshot). As a temporary solution, I added this array to the exclude
option and everything works as I need. But I think this is not the right way:
[
'/kk',
'/kk/**',
'/en',
'/en/**'
]
@altynbek07 I understand more. If you don't want the routes injected by the i18n module, you just have to declare the sitemap module before it as below:
{
modules: [
['@nuxtjs/sitemap', {
// some other sitemap options
// i18n: false
}],
['nuxt-i18n', {
locales: [
{ code: 'ru', name: "Русский", file: 'ru.js', iso: 'ru-RU' },
{ code: 'kk', name: "Қазақша", file: 'kk.js', iso: 'kk-KZ' },
{ code: 'en', name: "English", file: 'en.js', iso: 'en-US' }
],
defaultLocale: 'ru',
// and some other i18n options
}]
]
}
@NicoPennec Yes, It works. Thank you. I'm closing this issue.
Version
v2.4.0
Reproduction link
https://github.com/nuxt-community/sitemap-module
Steps to reproduce
Add i18n Add sitemap Configure both according to doc
What is expected ?
I want to disable autogenerated i18n routes in sitemap. In my
nuxt.config.js
I settedi18n: false
option insitemap
section:What is actually happening?
Sitemap still generated with i18n routes