aboutsummaryrefslogtreecommitdiff
path: root/templates/macros/head.html
diff options
context:
space:
mode:
authorJieiku2023-07-19 13:32:33 -0700
committerJieiku2023-07-19 13:32:33 -0700
commitcd71559564732e4f2b4752560ff1b6de6f737a79 (patch)
treef3fb6331389806a8c384c2d3459a125df61c34e0 /templates/macros/head.html
parent65f135a6a2f7be105bfe9ce95796b2314627b20d (diff)
downloadabridge-cd71559564732e4f2b4752560ff1b6de6f737a79.tar.gz
abridge-cd71559564732e4f2b4752560ff1b6de6f737a79.tar.bz2
abridge-cd71559564732e4f2b4752560ff1b6de6f737a79.zip
nojs configurable default switcher theme
Diffstat (limited to 'templates/macros/head.html')
-rw-r--r--templates/macros/head.html9
1 files changed, 7 insertions, 2 deletions
diff --git a/templates/macros/head.html b/templates/macros/head.html
index 6bc0275..25e981d 100644
--- a/templates/macros/head.html
+++ b/templates/macros/head.html
@@ -1,8 +1,13 @@
{#- Theme Switcher Button to toggle between dark/light #}
{%- macro theme(config) %}
{%- if config.extra.js_switcher | default(value=true) %}
- {%- set js_theme=config.extra.js_theme | default(value="js/theme.min.js") -%}
- {%- if js_theme %}
+ {%- set js_theme=config.extra.js_theme | default(value="") -%}
+ {%- if not js_theme %}
+ {%- if config.extra.js_switcher_default %}{%- if config.extra.js_switcher_default == "light" %}
+ {%- set js_theme="js/theme_light.min.js" -%}
+ {%- else %}
+ {%- set js_theme="js/theme.min.js" -%}
+ {%- endif %}{%- endif %}
<script src="{{ get_url(path=js_theme, trailing_slash=false) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path=js_theme, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- endif %}
{%- endif %}