From 53f078df2c9ba192bc2b2e399654ceafecd91a95 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Sun, 7 Apr 2024 19:38:53 +0200 Subject: [PATCH] made sure that the timestamps in the sitemap are all conforming to what google expects --- data/processors/sitemap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/processors/sitemap.py b/data/processors/sitemap.py index 79c5b4475..7b24b3f46 100644 --- a/data/processors/sitemap.py +++ b/data/processors/sitemap.py @@ -207,7 +207,7 @@ def _write_sitemapindex_xml(fname: Path, sitemaps: Sitemaps) -> None: loc.text = f"https://nav.tum.de/cdn/sitemap-data-{name}.xml" if lastmod_dates := {site["lastmod"] for site in sitemap if "lastmod" in site}: lastmod = ET.SubElement(sitemap_el, "lastmod") - lastmod.text = max(lastmod_dates).isoformat(timespec="seconds") + "Z" + lastmod.text = max(lastmod_dates).isoformat(timespec="seconds") # Because sitemaps cannot be hierarchical, we have to include the # webclient sitemap here as well. @@ -218,7 +218,7 @@ def _write_sitemapindex_xml(fname: Path, sitemaps: Sitemaps) -> None: sitemap = _download_online_sitemap(web_sitemap_url) if lastmod_dates := set(sitemap.values()): lastmod = ET.SubElement(sitemap_el, "lastmod") - lastmod.text = max(lastmod_dates).isoformat(timespec="seconds") + "Z" + lastmod.text = max(lastmod_dates).isoformat(timespec="seconds") root = ET.ElementTree(sitemapindex) root.write(fname, encoding="utf-8", xml_declaration=True)