From 9379e0a42c5cf06da2c12dab6db06a30209a194e Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Sun, 3 May 2026 20:16:13 +0800 Subject: [PATCH] style(sitemap): pretty-print generated sitemap.xml with 2-space indent Co-Authored-By: Claude --- website/build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/build.py b/website/build.py index db42c176..977105aa 100644 --- a/website/build.py +++ b/website/build.py @@ -234,7 +234,9 @@ def write_sitemap_xml(path: Path, urls: Sequence[tuple[str, str]]) -> None: lastmod_el = ET.SubElement(url_el, f"{{{SITEMAP_NS}}}lastmod") lastmod_el.text = lastmod - ET.ElementTree(urlset).write(path, encoding="utf-8", xml_declaration=True) + tree = ET.ElementTree(urlset) + ET.indent(tree, space=" ") + tree.write(path, encoding="utf-8", xml_declaration=True) with path.open("ab") as f: f.write(b"\n")