diff --git a/cmd/dashboard/controller/controller.go b/cmd/dashboard/controller/controller.go index 72628bd..4c2c2ba 100644 --- a/cmd/dashboard/controller/controller.go +++ b/cmd/dashboard/controller/controller.go @@ -25,8 +25,8 @@ func ServeWeb(port uint) { "tf": func(t time.Time) string { return t.Format("2006年1月2号") }, - "css": func(s string) template.CSS { - return template.CSS(s) + "safe": func(s string) template.HTML { + return template.HTML(s) }, "tag": func(s string) template.HTML { return template.HTML(`<` + s + `>`) diff --git a/resource/template/theme-default/home.html b/resource/template/theme-default/home.html index 04d2d55..02dd0c0 100644 --- a/resource/template/theme-default/home.html +++ b/resource/template/theme-default/home.html @@ -2,7 +2,7 @@ {{template "common/header" .}} {{if ts .CustomCSS}} {{tag "style"}} -{{.CustomCSS|css}} +{{.CustomCSS|safe}} {{tag "/style"}} {{end}} {{template "common/menu" .}} diff --git a/resource/template/theme-hotaru/home.html b/resource/template/theme-hotaru/home.html index 6a55c0b..992fbbe 100644 --- a/resource/template/theme-hotaru/home.html +++ b/resource/template/theme-hotaru/home.html @@ -21,7 +21,7 @@ {{if ts .CustomCSS}} {{tag "style"}} - {{.CustomCSS|css}} + {{.CustomCSS|safe}} {{tag "/style"}} {{end}}