Closed manuelernestog closed 1 year ago
Hi @manuelernestog! Could you provide some more information about what exactly is wrong with the format?
Hi @delucis, sure!
When you generate a Sitemap with Astro Sitemap Integration, it creates two files, the sitemap-index
and the sitemap-0.xml
If you take a look at some sitemap-0.xml
without the i18n config, it's look like this in the web browser
Now if you take a look at one generated with the i18n config, it's look like this
And it should look like this
As you can see, the web browser is not recognizing this as a xml valid file and Google Search Console is also unable to recognize URLs in the file
The minimal example have a website with just two index files (one for English and one for French). When you build the page and preview it you will find the same problem in the generated XML file.
Is this a bug with Astro or with astro-i18next
? It's unclear to me. Can you create an example that takes astro-i18next
out of the equation?
Our docs site doesn’t use i18next but does use the i18n
sitemap config and the sitemap renders without browser styles like OP’s example: https://docs.astro.build/sitemap-0.xml
(Worth noting though that’s a browser rendering quirk: if you “View source” or download the XML file, you’ll see the XML markup is still there.)
But we don’t have the same search console error:
@manuelernestog can you let us know what is wrong with the actual XML (and not how it's rendered by the browser)?
Sure @matthewp. First as you suggested before let me create an example without astro-i18next
Although it should not be interfering, it could be the reason for the problem.
Our docs site doesn’t use i18next but does use the
i18n
sitemap config and the sitemap renders without browser styles like OP’s example: https://docs.astro.build/sitemap-0.xml(Worth noting though that’s a browser rendering quirk: if you “View source” or download the XML file, you’ll see the XML markup is still there.)
But we don’t have the same search console error:
Thanks for the information @delucis, seeing this then maybe it could be some incompatibility problem with the plugin
I'm going to create another Minimal Reproducible Example to check if it's a compatibility issue with the plugin i18n
or is it something else. I'll get back to you as soon as I have it.
Closing as stale, please reopen if you still see. an issue. Thanks!
What version of
astro
are you using?1.6.11
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Linux
Describe the Bug
When you generate a sitemap using i18n config, the format of the
sitemap-0.xml
file is incorrect and tools like Google Search Console can't find any pages in it.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-de1e3v
Participation