修复: 组件隐藏状态启动不生效+相册显示开关
- body class 改用 {{BODY_CLASSES}} 模板变量替换,修复隐藏状态在启动时未应用
- 相册组件添加显示/隐藏开关
This commit is contained in:
@@ -106,9 +106,14 @@ func buildWallpaperHTML(cfg *Config) string {
|
||||
if cfg.HideKnowledge {
|
||||
bodyClasses = append(bodyClasses, "hide-knowledge")
|
||||
}
|
||||
if cfg.HidePhoto {
|
||||
bodyClasses = append(bodyClasses, "hide-photo")
|
||||
}
|
||||
if len(bodyClasses) > 0 {
|
||||
cls := strings.Join(bodyClasses, " ")
|
||||
html = strings.Replace(html, `layout-`+string(cfg.Layout), `layout-`+string(cfg.Layout)+" "+cls, 1)
|
||||
html = strings.Replace(html, "{{BODY_CLASSES}}", cls, 1)
|
||||
} else {
|
||||
html = strings.Replace(html, " {{BODY_CLASSES}}", "", 1)
|
||||
}
|
||||
|
||||
// 注入自定义文字
|
||||
|
||||
Reference in New Issue
Block a user