chore: inject HTMX script in all templates to fix badge bugs

This commit is contained in:
2026-06-15 23:09:23 +02:00
parent bcf92487ab
commit 2adbdde121
21 changed files with 34 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import os
import glob
template_dir = "/home/ucef/.gemini/antigravity/scratch/as-talange/as-talange-web/src/main/resources/templates"
html_files = glob.glob(template_dir + "/**/*.html", recursive=True)
for file in html_files:
with open(file, "r") as f:
content = f.read()
if "htmx.org" not in content and "<head>" in content:
content = content.replace("<head>", "<head>\n <script src=\"https://unpkg.com/htmx.org@1.9.11\"></script>")
with open(file, "w") as f:
f.write(content)
print(f"Fixed {file}")