Add precache to service worker

This commit is contained in:
Alex Shpak
2020-05-01 17:45:23 +02:00
parent e2ffa7b3ad
commit a877c17dc1
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -1,8 +1,10 @@
const cacheName = self.location.pathname
const pages = [
{{ if eq .Site.Params.BookServiceWorker "precache" }}
{{ range .Site.AllPages -}}
"{{ .RelPermalink }}",
{{ end }}
{{ end -}}
{{ end }}
];
self.addEventListener("install", function (event) {