When setup the config for nuxt-i18n in nuxt sitemap config the sitemap is not rendering properly.
sitemap: {
hostname: 'http://localhost:8080',
cacheTime: 600000,
gzip: true,
i18n: {
defaultLocale: 'en',
routesNameSeparator: '___'
}
},
This is the output of sitemap when enable i18n in the config.
But when i18n is not used in the sitemap config
sitemap: {
hostname: 'http://localhost:8080',
cacheTime: 600000,
gzip: true
},
Since the project does have multilanguage so I need to setup the i18n config for the sitemap so that the sitemap could have alternate link of all the multilange as shown in the image below
It's only a rendering issue on your browser, due to the xml namespace of the elements <xhtml:link>
. Your browser will convert the XML rendering to a XHTML page rendering because it see a know "xhtml:*" namespace.
Check the source code of the sitemap.xml, you will see that your XML file is correct.