Hugo: sitemap error: Namespace prefix xhtml on link is not defined (in multilingual site)

Created on 17 Oct 2017  路  4Comments  路  Source: gohugoio/hugo

Hugo version: 0.30

0859d9dfe647db3b8a192da38ad7efb5480a29a1 wraps xmlns:xhtml="http://www.w3.org/1999/xhtml" with if .IsTranslated block.

But as far as I know, .IsTranslated will always return false for the sitemap.xml template. So, xmlns:xhtml="http://www.w3.org/1999/xhtml" is never rendered. And it causes the following error:

Namespace prefix xhtml on link is not defined

I might be wrong, but I think #3933 should be reverted.

I've tested this on a multilingual site.

Bug

All 4 comments

Where do you get that validation error? Is it a "blocker"?

With the mentioned error present, Google Webmasters tool reports that the sitemap.xml file can't be parsed:

Google Webmasters tool
google-webmaster-hugo-sitemap-error

Google Chrome browser
google-chrome-hugo-sitemap-error

OK, that's not good.

Answer to https://github.com/gohugoio/hugo/issues/3978#issuecomment-337248361

.. Is it a "blocker"?

Yes, this prevents me to update from 0.27.1 to 0.3x

Was this page helpful?
0 / 5 - 0 ratings