mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2025-04-04 21:05:42 +00:00
8 lines
222 B
JavaScript
8 lines
222 B
JavaScript
{{- $swJS := resources.Get "sw.js" | resources.ExecuteAsTemplate "sw.js" . -}}
|
|
if (navigator.serviceWorker) {
|
|
navigator.serviceWorker.register(
|
|
"{{ $swJS.RelPermalink }}",
|
|
{ scope: "{{ "/" | relURL }}" }
|
|
);
|
|
}
|