Enhance type hinting
All checks were successful
Deploy to Server / deploy (push) Successful in 22s

This commit is contained in:
Joakim Hellsén 2026-04-05 03:57:18 +02:00
commit 06c0af7009
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
6 changed files with 100 additions and 49 deletions

View file

@ -141,7 +141,9 @@ def _render_urlset_xml(
xml += '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n'
for url_entry in url_entries:
xml += " <url>\n"
loc = url_entry.get("loc") or url_entry.get("url") # Handle both keys
loc: str | None = url_entry.get("loc") or url_entry.get(
"url",
) # Handle both keys
if loc:
xml += f" <loc>{loc}</loc>\n"
if "lastmod" in url_entry: