refactor(render): 解决国内可能存在的资源访问问题,新增大陆资源和海外资源可选项,允许用户根据服务器位置选择不同的资源策略,并且允许自定义资源镜像站

- Updated language attributes in HTML templates to dynamically set based on `t2i_font_source`.
- Replaced hardcoded Google Fonts links with dynamic links using `t2i_google_fonts_mirror` and `t2i_gstatic_mirror`.
- Adjusted font-family declarations to conditionally include 'Noto Sans SC' and 'Noto Sans TC' based on the `t2i_font_source`.
- Ensured consistent formatting and style across various templates including image, quote, topic, and user title items.
- Added missing newlines at the end of several files for consistency.
This commit is contained in:
SXP-Simon
2026-04-25 12:22:36 +08:00
parent 54f517d3b0
commit 948bfb1b5b
64 changed files with 614 additions and 219 deletions
+15
View File
@@ -125,6 +125,21 @@ class MockConfigManager:
def get_html_base_url(self) -> str:
return ""
def get_t2i_font_source(self) -> str:
return "Overseas"
def get_t2i_google_fonts_mirror(self) -> str:
return "https://fonts.googleapis.com"
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_rendering_strategies(self) -> list:
return []
async def mock_get_user_avatar(user_id: str) -> str:
# Return a known avatar URL for testing