Commit ded44ca9e8

ded44ca9e8363a32773de795e61c77afd174b333

parent: faf7486902

Unsigned

github-actions <41898282+github-actions[bot]@users.noreply.github.com> · 2025-07-14 21:05 UTC

Commit from GitHub Actions (Ruff)

Layout: unified · split

build.py +10 −6
@@ -281,14 +281,16 @@ def generate_sitemap(public_dir="public", base_url="https://cleberg.net"):
281281 rel_path = os.path.relpath(full_path, public_dir)
282282 url_path = "/" + quote(rel_path.replace(os.sep, "/"))
283283 # Remove index.html for cleaner URLs
284 if url_path.endswith('/index.html'):
285 url_path = url_path[:-10] or '/'
286 elif url_path == '/index.html':
287 url_path = '/'
284 if url_path.endswith("/index.html"):
285 url_path = url_path[:-10] or "/"
286 elif url_path == "/index.html":
287 url_path = "/"
288288 loc = f"{base_url}{url_path}"
289289
290290 # Last modified time
291 lastmod = datetime.utcfromtimestamp(os.path.getmtime(full_path)).strftime("%Y-%m-%d")
291 lastmod = datetime.utcfromtimestamp(
292 os.path.getmtime(full_path)
293 ).strftime("%Y-%m-%d")
292294
293295 sitemap_entries.append(f""" <url>
294296 <loc>{loc}</loc>
@@ -304,7 +306,9 @@ def generate_sitemap(public_dir="public", base_url="https://cleberg.net"):
304306 sitemap_path = os.path.join(public_dir, "sitemap.xml")
305307 with open(sitemap_path, "w", encoding="utf-8") as f:
306308 f.write(sitemap_xml)
307 print(f"Sitemap generated at {sitemap_path} with {len(sitemap_entries)} entries.")
309 print(
310 f"Sitemap generated at {sitemap_path} with {len(sitemap_entries)} entries."
311 )
308312
309313
310314def deploy_to_server(build_dir, server):