From a6995926c0b1f22f5713be5ce8d78fd0a523bc6f Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 21:05:08 +0000 Subject: Commit from GitHub Actions (Ruff) --- build.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index e608c8b..1052fe1 100644 --- a/build.py +++ b/build.py @@ -281,14 +281,16 @@ def generate_sitemap(public_dir="public", base_url="https://cleberg.net"): rel_path = os.path.relpath(full_path, public_dir) url_path = "/" + quote(rel_path.replace(os.sep, "/")) # Remove index.html for cleaner URLs - if url_path.endswith('/index.html'): - url_path = url_path[:-10] or '/' - elif url_path == '/index.html': - url_path = '/' + if url_path.endswith("/index.html"): + url_path = url_path[:-10] or "/" + elif url_path == "/index.html": + url_path = "/" loc = f"{base_url}{url_path}" # Last modified time - lastmod = datetime.utcfromtimestamp(os.path.getmtime(full_path)).strftime("%Y-%m-%d") + lastmod = datetime.utcfromtimestamp( + os.path.getmtime(full_path) + ).strftime("%Y-%m-%d") sitemap_entries.append(f""" {loc} @@ -304,7 +306,9 @@ def generate_sitemap(public_dir="public", base_url="https://cleberg.net"): sitemap_path = os.path.join(public_dir, "sitemap.xml") with open(sitemap_path, "w", encoding="utf-8") as f: f.write(sitemap_xml) - print(f"Sitemap generated at {sitemap_path} with {len(sitemap_entries)} entries.") + print( + f"Sitemap generated at {sitemap_path} with {len(sitemap_entries)} entries." + ) def deploy_to_server(build_dir, server): -- cgit v1.2.3-70-g09d2