add customize style / script

This commit is contained in:
微凉
2021-11-14 14:37:26 +08:00
parent 0f93d2bfed
commit 0dffb9aaa1
4 changed files with 39 additions and 6 deletions

View File

@ -61,4 +61,19 @@ func LoadSettings() {
if err == nil {
conf.CheckParent = checkParent.Value == "true"
}
}
favicon, err := GetSettingByKey("favicon")
if err == nil {
//conf.Favicon = favicon.Value
conf.IndexHtml = strings.Replace(conf.RawIndexHtml, "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png", favicon.Value, 1)
}
customizeStyle, err := GetSettingByKey("customize style")
if err == nil {
//conf.CustomizeStyle = customizeStyle.Value
conf.IndexHtml = strings.Replace(conf.IndexHtml, "/* customize-style */", customizeStyle.Value, 1)
}
customizeScript, err := GetSettingByKey("customize script")
if err == nil {
//conf.CustomizeStyle = customizeScript.Value
conf.IndexHtml = strings.Replace(conf.IndexHtml, "// customize-js", customizeScript.Value, 1)
}
}