diff options
| author | Jieiku | 2023-09-21 01:08:31 -0700 |
|---|---|---|
| committer | Jieiku | 2023-09-21 01:08:31 -0700 |
| commit | 265dd224d5268bddda494b641b834e06ade4e107 (patch) | |
| tree | 994f1e8e6c4a281103c285158d05e29807f1fbe4 /templates/partials/head_js.html | |
| parent | 50b9de0024fc492966fc731c0c300df489e47519 (diff) | |
| download | abridge-265dd224d5268bddda494b641b834e06ade4e107.tar.gz abridge-265dd224d5268bddda494b641b834e06ade4e107.tar.bz2 abridge-265dd224d5268bddda494b641b834e06ade4e107.zip | |
Disable PWA during Zola Serve
Diffstat (limited to 'templates/partials/head_js.html')
| -rw-r--r-- | templates/partials/head_js.html | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/templates/partials/head_js.html b/templates/partials/head_js.html index 9a5604a..0d3a8fb 100644 --- a/templates/partials/head_js.html +++ b/templates/partials/head_js.html @@ -22,17 +22,18 @@ {%- endif %} {%- endif %} - +{%- if config.mode != "serve" -%}{%- set notserve = true %}{%- endif %} {%- if config.extra.js_bundle %} + {%- if config.build_search_index %} - {%- if config.extra.pwa | default(value=false) %} + {%- if notserve and config.extra.pwa | default(value=false) %} <script defer src="{{ get_url(path='js/abridge.min.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/abridge.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- else %} <script defer src="{{ get_url(path='js/abridge_nopwa.min.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/abridge_nopwa.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} {%- else %} - {%- if config.extra.pwa | default(value=false) %} + {%- if notserve and config.extra.pwa | default(value=false) %} <script defer src="{{ get_url(path='js/abridge_nosearch.min.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/abridge_nosearch.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- else %} <script defer src="{{ get_url(path='js/abridge_nosearch_nopwa.min.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/abridge_nosearch_nopwa.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> @@ -68,7 +69,7 @@ <script defer src="{{ get_url(path='js/codecopy.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/codecopy.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} - {%- if config.extra.pwa | default(value=false) %} + {%- if notserve and config.extra.pwa | default(value=false) %} <script defer src="{{ get_url(path='js/sw_load.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/sw_load.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} |
