diff options
| author | Jieiku | 2023-05-22 22:39:16 -0700 |
|---|---|---|
| committer | Jieiku | 2023-05-22 22:39:16 -0700 |
| commit | 2d0788c3981328f1fbd9de4274d2925bf9586e03 (patch) | |
| tree | cee4b3c0a624ce79fcc14b2c57789a95578e4ea5 /templates/macros/head.html | |
| parent | 6dcec618d0ff0a2270f787f62267a0622275c69d (diff) | |
| download | abridge-2d0788c3981328f1fbd9de4274d2925bf9586e03.tar.gz abridge-2d0788c3981328f1fbd9de4274d2925bf9586e03.tar.bz2 abridge-2d0788c3981328f1fbd9de4274d2925bf9586e03.zip | |
Add multi-lingual Support
Diffstat (limited to 'templates/macros/head.html')
| -rw-r--r-- | templates/macros/head.html | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/templates/macros/head.html b/templates/macros/head.html index 8da09cb..0690bc1 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -103,7 +103,7 @@ {%- set js_email=config.extra.js_email | default(value="email.js") -%} {%- if js_email %} - {%- if config.extra.social.mail_encode | default(value=true) %} + {%- if config.extra.mail_encode | default(value=true) %} <script defer src="{{ get_url(path=js_email, trzailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path=js_email, sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} {%- endif %} @@ -120,12 +120,15 @@ {%- else %} <script defer src="{{ get_url(path='elasticlunr.min.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='elasticlunr.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> <script defer src="{{ get_url(path='search.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='search.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> - {%- endif %} - -{%- endif %} + {%- if lang != "en" %} + <script defer src="{{ get_url(path='lunr.stemmer.support.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='lunr.stemmer.support.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> + <script defer src="{{ get_url(path='lunr.' ~ lang ~ '.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='lunr.' ~ lang ~ '.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> + {%- endif %} + {%- endif %} +{%- endif %} {#- https://katex.org/docs/autorender.html #} @@ -344,9 +347,9 @@ <meta property="og:updated_time" content="{{ updated_time }}" /> {%- endif %} -{%- if config.extra.social.twitter %} - <meta name="twitter:site" content="@{{ config.extra.twitter }}" /> - <meta name="twitter:creator" content="@{{ config.extra.twitter }}" /> +{%- if config.extra.twitter_meta %} + <meta name="twitter:site" content="@{{ config.extra.twitter_meta }}" /> + <meta name="twitter:creator" content="@{{ config.extra.twitter_meta }}" /> {%- endif %} |
