mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-27 01:13:00 +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)
|
return template.HTML(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func rawCSS(s string) template.CSS {
|
||||||
|
return template.CSS(s)
|
||||||
|
}
|
||||||
|
|
||||||
type Renderer interface {
|
type Renderer interface {
|
||||||
Render(ctx *Context, writer io.Writer, page string, data interface{}) (err error)
|
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,
|
"WithContext": withContext,
|
||||||
"HTML": template.HTMLEscapeString,
|
"HTML": template.HTMLEscapeString,
|
||||||
"Raw": raw,
|
"Raw": raw,
|
||||||
|
"RawCSS": rawCSS,
|
||||||
}).ParseGlob(templateGlobPattern)
|
}).ParseGlob(templateGlobPattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<script src="/static/fluoride.js"></script>
|
<script src="/static/fluoride.js"></script>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if $.Ctx.UserCSS}}
|
{{if $.Ctx.UserCSS}}
|
||||||
<style>{{$.Ctx.UserCSS}}</style>
|
<style>{{RawCSS $.Ctx.UserCSS}}</style>
|
||||||
{{end}}
|
{{end}}
|
||||||
</head>
|
</head>
|
||||||
<body {{if $.Ctx.DarkMode}}class="dark"{{end}}>
|
<body {{if $.Ctx.DarkMode}}class="dark"{{end}}>
|
||||||
|
Loading…
Reference in New Issue
Block a user