From ec5728b1c3e1269caa10475e25222534c4b17359 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 25 Sep 2021 02:04:19 +0200 Subject: [PATCH] Add fonts to preloading with integrity this is currently not supported and is ignored but it does not hurt, it speeds up the page load and as soon as it is supported in the future it will start to work: https://crbug.com/981419 Signed-off-by: Knut Ahlers --- frontend/index.html | 16 ++++++++++++++-- tplFuncs.go | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 5efed59..054157d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -6,9 +6,20 @@ + {{ range (list "webfonts/fa-solid-900.woff2" "webfonts/fa-brands-400.woff2" "lato-v20-latin-ext_latin-regular.woff2" "lato-v20-latin-ext_latin-700.woff2") }} + {{ end }} + + @@ -39,7 +50,8 @@
diff --git a/tplFuncs.go b/tplFuncs.go index 6e6fb91..62df749 100644 --- a/tplFuncs.go +++ b/tplFuncs.go @@ -11,7 +11,8 @@ import ( var ( sriCacheStore = newSRICache() tplFuncs = template.FuncMap{ - "SRIHash": assetSRIHash, + "list": func(args ...string) []string { return args }, + "assetSRI": assetSRIHash, } )