How to reproduce
-
Have an old Hugo site on the default *.netlify.com subdomain
By old I mean that it was first configured before the switch to the *.netlify.app subdomains. -
Access your site’s sitemap, e.g. https://example.netlify.app/sitemap.xml (https://example.netlify.com/sitemap.xml also works and just redirects to the former)
-
In the sitemap XML all specified URIs still use the *.netlify.com subdomain.
Impact: For your *.netlify.app site you cannot register the sitemap in Google’s webmaster tools as it rejects the sitemap saying that it can only process URIs on the same subdomain (i.e. with *.netlify.app).
Workaround: Open netlify.toml
in your Hugo project and edit
[build]
command = "hugo --gc --minify -b $URL"
publish = "public"
to
[build]
command = "hugo --gc --minify -b https://example.netlify.app"
publish = "public"