getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

Problem with a multilanguage sitemap #94

Closed Agrasu closed 3 years ago

Agrasu commented 3 years ago

I have a problem with generating the sitemap in two language versions.

Now I have two versions in one sitemap, but I need this solution:

Propably I found an unnecessary(?) line 126 in file sitemap.php:

$pages->reset();

If i remove this line my sitemap is generated fine.

Can you solve the problem this way or another?

rhukster commented 3 years ago

Sitemap was not handling multi-language properly before. The sitemap is intended for Google and other bots to get a thorough understanding of your site, so we now follow the Goolge guidelines: https://developers.google.com/search/docs/advanced/crawling/localized-versions

If you were leveraging the sitemap for a visual representation (not for search engines), you can enable the new html_support option and this works on a per-language basis like it used to work before: https://github.com/getgrav/grav-plugin-sitemap#html-support