From 960e33d6491a4bbfdf12794ae504a26c526cc89c Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 16 Aug 2022 21:46:02 -0600 Subject: inline css into pages --- srv/src/http/tpl.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'srv/src/http/tpl.go') diff --git a/srv/src/http/tpl.go b/srv/src/http/tpl.go index fb0f5bd..2edd7ac 100644 --- a/srv/src/http/tpl.go +++ b/srv/src/http/tpl.go @@ -66,6 +66,11 @@ func (a *api) tplFuncs() template.FuncMap { path = filepath.Join("static", path) return a.blogURL(path, false) }, + "StaticInlineCSS": func(path string) (template.CSS, error) { + path = filepath.Join("static", path) + b, err := staticFS.ReadFile(path) + return template.CSS(b), err + }, "AssetURL": func(id string) string { path := filepath.Join("assets", id) return a.blogURL(path, false) -- cgit v1.2.3