aboutsummaryrefslogtreecommitdiff
path: root/templates/partials/head_js.html
diff options
context:
space:
mode:
authorJieiku2026-08-14 15:10:15 -0700
committerJieiku2026-08-14 15:10:15 -0700
commitc2d72e09747a2a4abe9602e1ba49a1b4649c9d3c (patch)
tree51a272ef184752e27bb70c07e4726dbdbbe6e237 /templates/partials/head_js.html
parentd52609f456f233ec0845c8a57a1e27583f0813ad (diff)
downloadabridge-c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c.tar.gz
abridge-c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c.tar.bz2
abridge-c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c.zip
Update for Zola 0.23.3
Diffstat (limited to 'templates/partials/head_js.html')
-rw-r--r--templates/partials/head_js.html52
1 files changed, 26 insertions, 26 deletions
diff --git a/templates/partials/head_js.html b/templates/partials/head_js.html
index 2a16b6d..af82de8 100644
--- a/templates/partials/head_js.html
+++ b/templates/partials/head_js.html
@@ -1,36 +1,36 @@
-{#- JAVASCRIPT #}
+{#- JAVASCRIPT -#}
{%- set integrity = config.extra.integrity | default(value=true) -%}
- {%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set integrity = false %}{% endif %}{% endif %}
+ {%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{%- set integrity = false -%}{%- endif -%}{%- endif -%}
{%- set search_library=config.extra.search_library | default(value="elasticlunr") -%}
- {%- set preStyle = false %}
+ {%- set preStyle = false -%}
- {%- if config.extra.fonts %}{%- for i in config.extra.fonts %}
- {%- if i.url is matching("^http[s]?://") %}
- {%- set preStyle = true %}
- {%- endif %}
- {%- endfor %}{%- endif %}
+ {%- if config.extra.fonts -%}{%- for i in config.extra.fonts -%}
+ {%- if i.url is matching(pat="^http[s]?://") -%}
+ {%- set preStyle = true -%}
+ {%- endif -%}
+ {%- endfor -%}{%- endif -%}
- {%- if config.extra.fontawesome %}
- {%- set preStyle = true %}
- {%- endif %}
+ {%- if config.extra.fontawesome -%}
+ {%- set preStyle = true -%}
+ {%- endif -%}
- {%- if config.extra.math or page.extra.math %}
+ {%- if config.extra.math or page?.extra?.math -%}
{%- set katex_css=config.extra.katex_css | default(value="katex.min.css") -%}
- {%- if katex_css %}
- {%- set preStyle = true %}
- {%- endif %}
- {%- endif %}
+ {%- if katex_css -%}
+ {%- set preStyle = true -%}
+ {%- endif -%}
+ {%- endif -%}
-{%- if config.mode != "serve" -%}{%- set notserve = true %}{%- endif %}
-{%- if config.extra.js_bundle %}
+{%- if config.mode != "serve" -%}{%- set notserve = true -%}{%- endif -%}
+{%- if config.extra.js_bundle -%}
- {%- if config.build_search_index %}
+ {%- if config.build_search_index -%}
{%- 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 %}
+ {%- endif -%}
{%- else %}
{%- if notserve and config.extra.pwa | default(value=false) %}
@@ -117,7 +117,7 @@
{#- https://katex.org/docs/autorender.html #}
{#- https://github.com/KaTeX/KaTeX/ #}
{#- https://github.com/KaTeX/KaTeX/tree/main/contrib/mathtex-script-type/ #}
-{%- if config.extra.math or page.extra.math %}
+{%- if config.extra.math or page?.extra?.math %}
{%- set katex_bundle=config.extra.katex_bundle | default(value="js/katexbundle.min.js") -%}
{%- if katex_bundle %}
@@ -125,23 +125,23 @@
{%- else %}
{%- set katex_js=config.extra.katex_js | default(value="js/katex.min.js") -%}
- {%- if katex_js %}{%- if katex_js is matching("^http[s]?://") %}
+ {%- if katex_js %}{%- if katex_js is matching(pat="^http[s]?://") %}
<script defer src="{{ katex_js | safe }}"{%- if integrity and config.extra.katex_js_integrity %} integrity="{{ config.extra.katex_js_integrity | safe }}"{%- endif %} crossorigin="anonymous"></script>
{%- else %}
<script defer src="{{ get_url(path=katex_js , trailing_slash=false, cachebust=true) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=katex_js, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- endif %}{%- endif %}
{%- set mathtex_js=config.extra.mathtex_js | default(value="js/mathtex-script-type.min.js") -%}
- {%- if mathtex_js %}{%- if mathtex_js is matching("^http[s]?://") %}
+ {%- if mathtex_js %}{%- if mathtex_js is matching(pat="^http[s]?://") %}
<script defer src="{{ mathtex_js | safe }}"{%- if integrity and config.extra.mathtex_js_integrity %} integrity="{{ config.extra.mathtex_js_integrity | safe }}"{%- endif %} crossorigin="anonymous"></script>
{%- else %}
<script defer src="{{ get_url(path=mathtex_js , trailing_slash=false, cachebust=true) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=mathtex_js, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- endif %}{%- endif %}
- {%- if config.extra.math_auto_render or page.extra.math_auto_render %}
+ {%- if config.extra.math_auto_render or page?.extra?.math_auto_render %}
{%- set katex_autorender_js=config.extra.katex_autorender_js | default(value="js/katex-auto-render.min.js") -%}
{%- if katex_autorender_js %}
- {%- if katex_autorender_js is matching("^http[s]?://") %}
+ {%- if katex_autorender_js is matching(pat="^http[s]?://") %}
<script defer src="{{ katex_autorender_js | safe }}"{%- if integrity and config.extra.katex_autorender_js_integrity %} integrity="{{ config.extra.katex_autorender_js_integrity | safe }}"{%- endif %} crossorigin="anonymous"></script>
{%- else %}
<script defer src="{{ get_url(path=katex_autorender_js , trailing_slash=false, cachebust=true) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=katex_autorender_js, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
@@ -161,4 +161,4 @@
-{#- End of head_js partial -#}
+{#- End of head_js partial #}