I’d like to modify the default placement of sitemaps. The docs say:
With a multilingual project, Hugo generates:
- A sitemap.xml file in the root of each site (language) using the built-in sitemap.xml template
- A sitemap.xml file in the root of the
publishDir
using the built-in sitemapindex.xml template
However I’d like to change this so it’s instead (differences bolded):
- A sitemap.xml file in the root of each site (language), except for the default language, using the built-in sitemap.xml template
- A sitemap.xml file in the root of the
publishDir
using the built-in sitemap.xml template for the default lang - A sitemap_index.xml file in the root of the
publishDir
using the built-in sitemapindex.xml template which outputs all language sitemaps.
Resulting structure would be:
https://example.com/sitemap.xml = contains only English language URLs on the main domain. This does not need to include the other languages.
https://example.com/es/sitemap.xml = contains all Spanish language URLs
https://example.com/ja/sitemap.xml = etc.
https://example.com/zh/sitemap.xml = etc.
https://example.com/ko/sitemap.xml
https://example.com/de/sitemap.xml
https://example.com/fr/sitemap.xml
https://example.com/es/sitemap.xml
https://example.com/sitemap_index.xml = references all of the XML sitemaps above
Is there a way of doing this without disabling the default sitemaps, and creating a custom output type with corresponding content files?