Skip to content

Commit 55d7a51

Browse files
authored
fix: add support for multihost (#50)
1 parent af51c9e commit 55d7a51

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

layouts/partials/pwa/assets/sw.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
{{/* JS compile options. */}}
44
{{- $precaches := slice }}
55
{{- $langs := slice }}
6+
{{- $host := .Site.BaseURL }}
67
{{/* Get precaches pages. */}}
78
{{- range .Sites }}
9+
{{/* Do not precache other hosts assets. */}}
10+
{{- if ne $host .BaseURL }}
11+
{{- continue }}
12+
{{- end }}
813
{{- $langs = $langs | append .Language.Lang }}
914
{{- $home := .GetPage "/" }}
1015
{{- if not $home }}

0 commit comments

Comments
 (0)