cmc/cleberg.net

My personal web garden & blog.

clone: git clone https://gitbay.org/cmc/cleberg.net.git

ded44ca9e8363a32773de795e61c77afd174b333

unsigned

author: github-actions <41898282+github-actions[bot]@users.noreply.github.com> · 2025-07-14T21:05:08Z

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"""  <url>
     <loc>{loc}</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):