fix(ATRI): 将镜像地址配置注入到子模板渲染上下文中,解决子模板中变量未定义导致的问题

This commit is contained in:
SXP-Simon
2026-04-27 17:03:59 +08:00
parent 09b4d188f2
commit 616d16010c
5 changed files with 40 additions and 25 deletions
+11 -4
View File
@@ -125,8 +125,8 @@ class MockConfigManager:
def get_html_base_url(self) -> str:
return ""
def get_t2i_font_source(self) -> str:
return "Overseas"
def get_t2i_atri_font_mirror(self) -> str:
return "https://tc.ciallo.ccwu.cc"
def get_t2i_google_fonts_mirror(self) -> str:
return "https://fonts.googleapis.com"
@@ -134,8 +134,8 @@ class MockConfigManager:
def get_t2i_gstatic_mirror(self) -> str:
return "https://fonts.gstatic.com"
def get_t2i_atri_font_mirror(self) -> str:
return "https://tc.ciallo.ccwu.cc"
def get_t2i_font_source(self) -> str:
return "Overseas"
def get_t2i_rendering_strategies(self) -> list:
return []
@@ -325,6 +325,13 @@ async def debug_render(
"image_template.html", **render_payload
)
# 复用最终 HTML 中所有内联头像资源,并注入复用样式
final_html = generator._reuse_avatars_in_final_html(
final_html,
render_payload.get("avatar_reuse_registry", {}),
render_payload.get("avatar_reuse_aliases", {}),
)
# 6. Save to file
output_path = Path(output_file)
output_path.write_text(final_html, encoding="utf-8")