diff options
Diffstat (limited to 'templates')
| -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 %} |
