WordPress / openverse-frontend

The gateway to the Openverse. Openverse is a search tool for CC-licensed and public domain content across the internet.
https://wordpress.org/openverse
MIT License
72 stars 64 forks source link

Sitemap is not correct for i18n routes #2164

Closed obulat closed 1 year ago

obulat commented 1 year ago

Problem

The sitemap lists all available routes instead of grouping all localized URLs of the same page. This is what it is like now:

<url><loc>https://openverse.org/about</loc></url>
<url><loc>https://openverse.org/af</loc></url>
<url><loc>https://openverse.org/am</loc></url>
<url><loc>https://openverse.org/an</loc></url>
<url><loc>https://openverse.org/ar</loc></url>

Description

<url xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<loc>https://openverse.org/about</loc>
<xhtml:link xmlns:xhtml="http://www.w3.org/1999/xhtml" rel="alternate" hreflang="ar" href="https://openverse.org/ar/about" />
<xhtml:link xmlns:xhtml="http://www.w3.org/1999/xhtml" rel="alternate" hreflang="en" href="https://openverse.org/about" />
<xhtml:link xmlns:xhtml="http://www.w3.org/1999/xhtml" rel="alternate" hreflang="es" href="https://openverse.org/es/about" />
<xhtml:link xmlns:xhtml="http://www.w3.org/1999/xhtml" rel="alternate" hreflang="ru" href="https://openverse.org/ru/about" />
</url>