diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2020-04-12 20:50:03 +0200 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2020-04-12 20:50:03 +0200 |
commit | 9719692512325b5f88de666281ba286343408010 (patch) | |
tree | 2551be94373e26f668f8756bee493c9b11ee48e0 /layouts/partials | |
parent | e4e43bd9b12a3e37f0d3c2760ea7f867ba8273a7 (diff) |
Introduce serviceWorker, disabled by default
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/docs/html-head.html | 7 |
1 files changed, 6 insertions, 1 deletions
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 @@ <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}"> {{- 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 }} <script defer src="{{ $searchJS.RelPermalink }}" integrity="{{ $searchJS.Data.Integrity }}"></script> {{ end -}} +{{- if .Site.Params.BookServiceWorker }} +{{- $swJS := resources.Get "sw-register.js" | resources.ExecuteAsTemplate "sw.js" . | resources.Minify | resources.Fingerprint }} +<script defer src="{{ $swJS.RelPermalink }}" integrity="{{ $swJS.Data.Integrity }}"></script> +{{ end -}} + {{- template "_internal/google_analytics_async.html" . -}} <!-- RSS --> |