theme v1
This commit is contained in:
@@ -89,6 +89,12 @@ func Init() error {
|
||||
// ini 键留空会被 int 解析为 0;<1 的值一律回退内置默认,防止上限被静默置零。
|
||||
sanitizeLimits(&Limits)
|
||||
|
||||
// 主题:默认 slug 与启用清单。段缺失时 MapTo 得到空值,运行期回退内置 default,
|
||||
// 因此老配置文件不写 [theme] 也能正常启动。
|
||||
if err := File.Section("theme").MapTo(&Theme); err != nil {
|
||||
return errors.Wrap(err, "map 'theme'")
|
||||
}
|
||||
|
||||
if err := File.Section("mail").MapTo(&Mail); err != nil {
|
||||
return errors.Wrap(err, "map 'mail'")
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ package conf
|
||||
var (
|
||||
BuildTime string
|
||||
BuildCommit = "dev"
|
||||
|
||||
// StaticVersion 静态资源缓存版本号:base.css 与主题 css 共用,改样式只改这一处。
|
||||
StaticVersion = "20261019e"
|
||||
)
|
||||
|
||||
// 文本审核通道取值([security] text_censor_source)。定义在 conf 侧,
|
||||
@@ -35,6 +38,15 @@ var (
|
||||
FontPath string `ini:"font_path"`
|
||||
}
|
||||
|
||||
// Theme 主题系统([theme] 段)。
|
||||
// default :站点默认主题 slug,留空/非法回退内置 default(= 现在的外观)。
|
||||
// available :启用哪些主题(逗号分隔),同时是箱主设置页的白名单;
|
||||
// 列了但缺少 css 文件的会被忽略并告警(见 internal/theme)。
|
||||
Theme struct {
|
||||
Default string `ini:"default"`
|
||||
Available string `ini:"available"`
|
||||
}
|
||||
|
||||
Security struct {
|
||||
EnableTextCensor bool `ini:"enable_text_censor"`
|
||||
IPBlacklist string `ini:"ip_blacklist"`
|
||||
|
||||
Reference in New Issue
Block a user