mirror of
https://github.com/nezhahq/nezha.git
synced 2025-02-08 20:48:13 -05:00
🐛 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 {
|
"tf": func(t time.Time) string {
|
||||||
return t.Format("2006年1月2号")
|
return t.Format("2006年1月2号")
|
||||||
},
|
},
|
||||||
"css": func(s string) template.CSS {
|
"safe": func(s string) template.HTML {
|
||||||
return template.CSS(s)
|
return template.HTML(s)
|
||||||
},
|
},
|
||||||
"tag": func(s string) template.HTML {
|
"tag": func(s string) template.HTML {
|
||||||
return template.HTML(`<` + s + `>`)
|
return template.HTML(`<` + s + `>`)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{{template "common/header" .}}
|
{{template "common/header" .}}
|
||||||
{{if ts .CustomCSS}}
|
{{if ts .CustomCSS}}
|
||||||
{{tag "style"}}
|
{{tag "style"}}
|
||||||
{{.CustomCSS|css}}
|
{{.CustomCSS|safe}}
|
||||||
{{tag "/style"}}
|
{{tag "/style"}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{template "common/menu" .}}
|
{{template "common/menu" .}}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<link rel="stylesheet" href="/static/theme-hotaru/css/darkmode.css?v202012121912" type="text/css">
|
<link rel="stylesheet" href="/static/theme-hotaru/css/darkmode.css?v202012121912" type="text/css">
|
||||||
{{if ts .CustomCSS}}
|
{{if ts .CustomCSS}}
|
||||||
{{tag "style"}}
|
{{tag "style"}}
|
||||||
{{.CustomCSS|css}}
|
{{.CustomCSS|safe}}
|
||||||
{{tag "/style"}}
|
{{tag "/style"}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
Reference in New Issue
Block a user