Update client dependencies

This commit is contained in:
Ken-Håvard Lieng 2020-04-30 07:54:30 +02:00
parent 1794e2680a
commit 508a41ee45
26 changed files with 4998 additions and 5245 deletions

View file

@ -28,7 +28,6 @@ const indexTemplate = `
<script src="{{.}}" defer></script>
{{end}}
<link rel="preload" href="/font/fontello.woff2?48901973" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/font/RobotoMono-Regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/font/Montserrat-Regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/font/Montserrat-Bold.woff2" as="font" type="font/woff2" crossorigin>

View file

@ -155,12 +155,7 @@ func (d *Dispatch) initFileServer() {
hash.Write(indexPage)
indexHash := base64.StdEncoding.EncodeToString(hash.Sum(nil))
serviceWorker = append(serviceWorker, []byte(`
workbox.precaching.precacheAndRoute([{
revision: '`+indexHash+`',
url: '/'
}]);
workbox.routing.registerNavigationRoute('/');`)...)
serviceWorker = bytes.Replace(serviceWorker, []byte("__INDEX_REVISON__"), []byte(indexHash), 1)
if cfg.HTTPS.HSTS.Enabled && cfg.HTTPS.Enabled {
hstsHeader = "max-age=" + cfg.HTTPS.HSTS.MaxAge