aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--renderer/renderer.go5
-rw-r--r--templates/header.tmpl2
2 files changed, 6 insertions, 1 deletions
diff --git a/renderer/renderer.go b/renderer/renderer.go
index f1595a5..c6b3189 100644
--- a/renderer/renderer.go
+++ b/renderer/renderer.go
@@ -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
diff --git a/templates/header.tmpl b/templates/header.tmpl
index 1abb6dd..8a1b0ca 100644
--- a/templates/header.tmpl
+++ b/templates/header.tmpl
@@ -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}}>