From a877c17dc1ea541a54e46e3c3214e4d96b70e6cc Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Fri, 1 May 2020 17:45:23 +0200 Subject: Add precache to service worker --- assets/sw.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'assets/sw.js') 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) { -- cgit v1.2.3