i18n option only generates <url> for default language

ems1985
0
ems1985
commented 3 months ago

Version

2.3.2

Reproduction link

https://github.com/nuxt-community/sitemap-module/blob/dev/README.md

Steps to reproduce

(Please note that the reproduction link, is just as a link to the docs, because the problem is already shown in the i18n docs example.)

When using the i18n option to generate a sitemap, only one <url> is generated for all language versions. But, according to a Google post (https://support.google.com/webmasters/answer/189077) there should be a <url> created for every page. I know it seems redundant, but I guess thats how it should be.

What is expected ?

 <url>
    <loc>https://example.com/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/"/>
  </url>
 <url>
    <loc>https://example.com/es/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/"/>
  </url>

What is actually happening?

 <url>
    <loc>https://example.com/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/"/>
  </url>
bug
0
ems1985
0
ems1985
commented 3 months ago

This is the problem shown in the Google Search Console. I actually have 42 URLs, but because of the way the sitemap is generated it only shows 21:

Screenshot 2020-06-19 at 12.42.46.png

0
Informations
Bug Report โ€ข Open
#c105 - Created 3 months ago