🐛 fix(template): 自定义CSS
This commit is contained in:
parent
8323a26bad
commit
fb770573d5
@ -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 + `>`)
|
||||
|
@ -2,7 +2,7 @@
|
||||
{{template "common/header" .}}
|
||||
{{if ts .CustomCSS}}
|
||||
{{tag "style"}}
|
||||
{{.CustomCSS|css}}
|
||||
{{.CustomCSS|safe}}
|
||||
{{tag "/style"}}
|
||||
{{end}}
|
||||
{{template "common/menu" .}}
|
||||
|
@ -21,7 +21,7 @@
|
||||
<link rel="stylesheet" href="/static/theme-hotaru/css/darkmode.css?v202012121912" type="text/css">
|
||||
{{if ts .CustomCSS}}
|
||||
{{tag "style"}}
|
||||
{{.CustomCSS|css}}
|
||||
{{.CustomCSS|safe}}
|
||||
{{tag "/style"}}
|
||||
{{end}}
|
||||
</head>
|
||||
|
Loading…
Reference in New Issue
Block a user