diff options
| author | Jieiku | 2026-08-14 15:10:15 -0700 |
|---|---|---|
| committer | Jieiku | 2026-08-14 15:10:15 -0700 |
| commit | c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c (patch) | |
| tree | 51a272ef184752e27bb70c07e4726dbdbbe6e237 /templates/partials | |
| parent | d52609f456f233ec0845c8a57a1e27583f0813ad (diff) | |
| download | abridge-c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c.tar.gz abridge-c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c.tar.bz2 abridge-c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c.zip | |
Update for Zola 0.23.3
Diffstat (limited to 'templates/partials')
| -rw-r--r-- | templates/partials/head.html | 44 | ||||
| -rw-r--r-- | templates/partials/head_js.html | 52 | ||||
| -rw-r--r-- | templates/partials/social.html | 4 |
3 files changed, 44 insertions, 56 deletions
diff --git a/templates/partials/head.html b/templates/partials/head.html index 668b811..e020404 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -21,7 +21,7 @@ <link rel="stylesheet" href="{{ get_url(path=i , trailing_slash=false, cachebust=true) | safe }}" /> {%- endfor %}{%- endif %} - {%- if page.extra.stylesheets %}{%- set pagestylesheets=page.extra.stylesheets -%}{%- endif %} + {%- if page?.extra?.stylesheets %}{%- set pagestylesheets=page?.extra?.stylesheets -%}{%- endif %} {%- if pagestylesheets %}{%- for i in pagestylesheets %} <link rel="stylesheet" href="{{ get_url(path=i , trailing_slash=false, cachebust=true) | safe }}" /> {%- endfor %}{%- endif %} @@ -98,7 +98,7 @@ {%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set integrity = false %}{% endif %}{% endif %} {%- if config.extra.fonts %}{%- for i in config.extra.fonts %} - {%- if i.url is matching("^http[s]?://") %} + {%- if i.url is matching(pat="^http[s]?://") %} <link rel="preload" as="style" class="preStyle" href="{{ i.url | safe }}" crossorigin="anonymous" /> {%- else %} <link rel="preload" as="font" href="{{ get_url(path=i.url, trailing_slash=false) | safe }}" type="font/woff2" /> @@ -109,10 +109,10 @@ <link rel="preload" as="style" class="preStyle" href="{{ config.extra.fontawesome | safe }}" crossorigin="anonymous" /> {%- 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 %}{%- if katex_css is matching("^http[s]?://") %} + {%- if katex_css %}{%- if katex_css is matching(pat="^http[s]?://") %} <link rel="preload" as="style" class="preStyle" href="{{ katex_css | safe }}"{%- if integrity and config.extra.katex_css_integrity %} integrity="{{ config.extra.katex_css_integrity | safe }}"{%- endif %} crossorigin="anonymous" /> {%- else %} <link rel="preload" as="style" class="preStyle" href="{{ get_url(path=katex_css, trailing_slash=false) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=katex_css, sha_type=384, base64=true) | safe }}"{%- endif %} /> @@ -124,31 +124,19 @@ -{#- Rss / Atom Feed #} - - {%- if config.generate_feeds %} - {%- for feed in config.feed_filenames %} - - {%- if feed is containing('atom') %} +{#- Rss / Atom Feed -#} +{%- if config.generate_feeds -%} +{%- for feed in config.feed_filenames -%} +{%- if feed is containing(pat='atom') %} <link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" /> - {%- endif %} - - {%- if feed is containing('rss') %} +{%- endif -%} +{%- if feed is containing(pat='rss') %} <link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" /> - {%- endif %} - - {%- endfor %} - {%- endif %} - - - - - -{#- Extra items #} - {%- if config.extra.head_extra %} +{%- endif -%} +{%- endfor -%} +{%- endif -%} +{#- Extra items -#} +{%- if config.extra.head_extra %} {{ config.extra.head_extra | safe }} - {%- endif %} - - - +{%- endif -%} {#- End of head partial -#} 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 #} diff --git a/templates/partials/social.html b/templates/partials/social.html index 73e8bb2..a44142a 100644 --- a/templates/partials/social.html +++ b/templates/partials/social.html @@ -3,9 +3,9 @@ {%- if config.generate_feeds and config.extra.feed -%} {%- for feed in config.feed_filenames -%} - {%- if feed is containing('atom') -%} + {%- if feed is containing(pat='atom') -%} <a type="application/atom+xml" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" target="_blank" title="{{ config.title }} Atom Feed"><i type="Button" class="svg rss" title="{{ config.title }} Atom Feed"></i></a>{% endif -%} - {%- if feed is containing('rss') -%} + {%- if feed is containing(pat='rss') -%} <a type="application/rss+xml" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" target="_blank" title="{{ config.title }} RSS Feed"><i type="Button" class="svg rss" title="{{ config.title }} RSS Feed"></i></a>{% endif -%} {%- endfor -%} |
