diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2020-05-01 17:45:23 +0200 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2020-05-01 17:45:23 +0200 |
commit | a877c17dc1ea541a54e46e3c3214e4d96b70e6cc (patch) | |
tree | 166ce13676ef0017896a68ec9022d4e2497918a8 /assets/sw.js | |
parent | e2ffa7b3ad920d577cc56fbaaea12a99be125774 (diff) |
Add precache to service worker
Diffstat (limited to 'assets/sw.js')
-rw-r--r-- | assets/sw.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/assets/sw.js b/assets/sw.js index 0e7b0cf..2ff11fc 100644 --- a/assets/sw.js +++ b/assets/sw.js @@ -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) { |