mirror of
https://github.com/Luzifer/ots.git
synced 2025-04-19 06:55:51 -04:00
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 <knut@ahlers.me>
This commit is contained in:
parent
ad39d8ca23
commit
ec5728b1c3
@ -6,9 +6,20 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
{{ 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") }}
|
||||
<link
|
||||
as="font"
|
||||
crossorigin="anonymous"
|
||||
href="{{ . }}"
|
||||
integrity="{{ assetSRI . }}"
|
||||
rel="preload"
|
||||
>
|
||||
{{ end }}
|
||||
|
||||
<link
|
||||
crossorigin="anonymous"
|
||||
href="css/all.min.css"
|
||||
integrity="{{ SRIHash `css/all.min.css` }}"
|
||||
integrity="{{ assetSRI `css/all.min.css` }}"
|
||||
rel="stylesheet"
|
||||
>
|
||||
|
||||
@ -39,7 +50,8 @@
|
||||
<div id="app"></div>
|
||||
|
||||
<script
|
||||
integrity="{{ SRIHash `app.js` }}"
|
||||
crossorigin="anonymous"
|
||||
integrity="{{ assetSRI `app.js` }}"
|
||||
src="app.js"
|
||||
></script>
|
||||
</body>
|
||||
|
@ -11,7 +11,8 @@ import (
|
||||
var (
|
||||
sriCacheStore = newSRICache()
|
||||
tplFuncs = template.FuncMap{
|
||||
"SRIHash": assetSRIHash,
|
||||
"list": func(args ...string) []string { return args },
|
||||
"assetSRI": assetSRIHash,
|
||||
}
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user