修 test01:窄屏装饰全藏导致素材消失、主题名显示成 i18n key

- 生成器:勾「窄屏隐藏全部装饰层」时给橙色警告(几层会消失)、图层行标「窄屏隐藏」、加层与导出结果再提醒;「窄屏」下拉在被全藏覆盖时标注不生效
- 新增 ?narrow=hide 复现该状态(这是「素材在手机上看不到」的头号来源:@media 把 10 槽全写 none,桌面完全正常)
- 主题名:新增 theme.DisplayName + 模板函数 themeName,i18n 未登记 theme.name.<slug> 时回退 slug;原来模板直接调用 i18n.T,缺词条就显示 "theme.name.test01"
- test01.css 删掉 @media 全 none 段:装饰是 fit 单位,浏览器会自己按视口缩,不需要这段
- StaticVersion → 20261020g(主题 css 内容变了,必须换缓存键,否则浏览器还会用旧文件)
This commit is contained in:
tamakyi
2026-10-20 18:23:21 +08:00
parent 3d0239d8f1
commit 6c014b3ad2
8 changed files with 110 additions and 105 deletions
+7
View File
@@ -19,6 +19,7 @@ import (
"github.com/tamakyi/TamaBox/internal/conf"
"github.com/tamakyi/TamaBox/internal/i18n"
"github.com/tamakyi/TamaBox/internal/security/moderation"
"github.com/tamakyi/TamaBox/internal/theme"
)
var (
@@ -192,6 +193,12 @@ func FuncMap() []template.FuncMap {
"langName": func(lang string) string {
return i18n.Name(lang)
},
// themeName 返回主题显示名:i18n 没有 theme.name.<slug> 时回退成 slug 本身。
// 别在模板里直接 {{t .LangCode (printf "theme.name.%s" .Slug)}} ——
// i18n.T 缺词条返回 key,设置页就会显示 "theme.name.test01"。
"themeName": func(lang, slug string) string {
return theme.DisplayName(lang, slug)
},
// moderationStrictness 返回账号「最终生效」的审核严格度档位(lax / standard / strict)。
//