feat: add UMass Amherst theme support, implement HTML snippet management system, and update page rendering logic
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import re
|
||||
|
||||
filepath = "src/main/resources/templates/themes/umass/footer.html"
|
||||
with open(filepath, "r", encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
|
||||
# We want to replace the `a.logo` block with our new logo
|
||||
# Using DOTALL to match across newlines
|
||||
pattern = r'<a class="logo"[^>]*>.*?</a>'
|
||||
replacement = '<a class="logo" href="/" aria-label="Sisvietnamvn">\n <div>\n <img th:src="@{/theme-assets/umass/images/logo.png}" alt="Sisvietnamvn" style="height: 60px; width: auto;"/>\n </div>\n</a>'
|
||||
|
||||
content = re.sub(pattern, replacement, content, count=1, flags=re.DOTALL)
|
||||
|
||||
with open(filepath, "w", encoding="utf-8") as f:
|
||||
f.write(content)
|
||||
print("Updated footer.html")
|
||||
Reference in New Issue
Block a user