From 9719692512325b5f88de666281ba286343408010 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Sun, 12 Apr 2020 20:50:03 +0200 Subject: Introduce serviceWorker, disabled by default --- layouts/partials/docs/html-head.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html index eb013d2..4b0c62f 100644 --- a/layouts/partials/docs/html-head.html +++ b/layouts/partials/docs/html-head.html @@ -16,11 +16,16 @@ {{- if default true .Site.Params.BookSearch }} -{{- $searchJSFile := printf "%s.search.js" .Language.Lang -}} +{{- $searchJSFile := printf "%s.search.js" .Language.Lang }} {{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }} {{ end -}} +{{- if .Site.Params.BookServiceWorker }} +{{- $swJS := resources.Get "sw-register.js" | resources.ExecuteAsTemplate "sw.js" . | resources.Minify | resources.Fingerprint }} + +{{ end -}} + {{- template "_internal/google_analytics_async.html" . -}} -- cgit v1.2.3