mirror of
https://git.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-28 22:51:27 +00:00
Fix custom CSS
This commit is contained in:
parent
471701f029
commit
4ad71587d8
|
@ -129,6 +129,10 @@ func raw(s string) template.HTML {
|
|||
return template.HTML(s)
|
||||
}
|
||||
|
||||
func rawCSS(s string) template.CSS {
|
||||
return template.CSS(s)
|
||||
}
|
||||
|
||||
type Renderer interface {
|
||||
Render(ctx *Context, writer io.Writer, page string, data interface{}) (err error)
|
||||
}
|
||||
|
@ -150,6 +154,7 @@ func NewRenderer(templateGlobPattern string) (r *renderer, err error) {
|
|||
"WithContext": withContext,
|
||||
"HTML": template.HTMLEscapeString,
|
||||
"Raw": raw,
|
||||
"RawCSS": rawCSS,
|
||||
}).ParseGlob(templateGlobPattern)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<script src="/static/fluoride.js"></script>
|
||||
{{end}}
|
||||
{{if $.Ctx.UserCSS}}
|
||||
<style>{{$.Ctx.UserCSS}}</style>
|
||||
<style>{{RawCSS $.Ctx.UserCSS}}</style>
|
||||
{{end}}
|
||||
</head>
|
||||
<body {{if $.Ctx.DarkMode}}class="dark"{{end}}>
|
||||
|
|
Loading…
Reference in a new issue