feat: make home welcome/subtitle configurable and fix settings render

Add home_welcome and home_subtitle fields (zh/en) to site_settings so
the home page heading and subtitle are editable from the admin panel,
falling back to the i18n defaults when empty. Wire them through the
config cache, SetUserContext, DefaultData, and home.html.

Fix the /admin/settings/site page rendering blank: Go templates cannot
invoke methods on an interface{}-wrapped struct, so pre-compute
SiteLogoIsURL in the handler instead of calling .Site.LogoIsURL() in
the template.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 20:41:45 +08:00
co-authored by Claude Fable 5
parent e3367e6e12
commit 0c5bcde7da
7 changed files with 89 additions and 8 deletions
+8
View File
@@ -150,6 +150,10 @@ var translations = map[Lang]map[string]string{
"settings_logo_text_en": "Site Title (English)",
"settings_header_text_zh": "Header Banner Text (Chinese)",
"settings_header_text_en": "Header Banner Text (English)",
"settings_home_welcome_zh": "Home Welcome Heading (Chinese)",
"settings_home_welcome_en": "Home Welcome Heading (English)",
"settings_home_subtitle_zh": "Home Subtitle (Chinese)",
"settings_home_subtitle_en": "Home Subtitle (English)",
"settings_footer_text_zh": "Footer Text (Chinese)",
"settings_footer_text_en": "Footer Text (English)",
"settings_leave_blank": "Leave blank to use the built-in default.",
@@ -318,6 +322,10 @@ var translations = map[Lang]map[string]string{
"settings_logo_text_en": "站点标题(英文)",
"settings_header_text_zh": "顶部横幅文本(中文)",
"settings_header_text_en": "顶部横幅文本(英文)",
"settings_home_welcome_zh": "主页欢迎标题(中文)",
"settings_home_welcome_en": "主页欢迎标题(英文)",
"settings_home_subtitle_zh": "主页副标题(中文)",
"settings_home_subtitle_en": "主页副标题(英文)",
"settings_footer_text_zh": "页脚文本(中文)",
"settings_footer_text_en": "页脚文本(英文)",
"settings_leave_blank": "留空则使用内置默认值。",