Refs #27395 -- Added XML namespace declaration to sitemap template.

As per Google recommendations:
https://support.google.com/webmasters/answer/189077?hl=en
This commit is contained in:
Carlton Gibson 2020-07-29 10:30:55 +02:00 committed by Carlton Gibson
parent 948a874425
commit 50e1ccbbea
4 changed files with 10 additions and 10 deletions

View file

@ -23,7 +23,7 @@ class HTTPSSitemapTests(SitemapTestsBase):
"A secure sitemap section can be rendered"
response = self.client.get('/secure/sitemap-simple.xml')
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url>
</urlset>
""" % (self.base_url, date.today())
@ -48,7 +48,7 @@ class HTTPSDetectionSitemapTests(SitemapTestsBase):
"A sitemap section requested in HTTPS is rendered with HTTPS links"
response = self.client.get('/simple/sitemap-simple.xml', **self.extra)
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url>
</urlset>
""" % (self.base_url.replace('http://', 'https://'), date.today())