feat: add UMass Amherst theme support, implement HTML snippet management system, and update page rendering logic
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import re
|
||||
|
||||
filepath = "src/main/resources/templates/themes/umass/header.html"
|
||||
with open(filepath, "r", encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
|
||||
# Tophat logo
|
||||
content = re.sub(
|
||||
r'<div class="tophat-logo">\s*<a href="[^"]*">\s*<img[^>]*>\s*</a>\s*</div>',
|
||||
'<div class="tophat-logo">\n <a href="/">\n <img th:src="@{/theme-assets/umass/images/logo.png}" alt="Sisvietnamvn" style="height: 35px; width: auto;"/>\n </a>\n </div>',
|
||||
content
|
||||
)
|
||||
|
||||
# Header branding logos
|
||||
content = re.sub(
|
||||
r'<div data-component-id="umass_base:header-branding">\s*<a href="[^"]*">\s*<img[^>]*>\s*<img[^>]*>\s*</a>\s*</div>',
|
||||
'<div data-component-id="umass_base:header-branding">\n <a href="/">\n <img th:src="@{/theme-assets/umass/images/logo.png}" alt="Sisvietnamvn" style="height: 60px; width: auto;"/>\n </a>\n</div>',
|
||||
content
|
||||
)
|
||||
|
||||
with open(filepath, "w", encoding="utf-8") as f:
|
||||
f.write(content)
|
||||
print("Updated header.html")
|
||||
Reference in New Issue
Block a user