aboutsummaryrefslogtreecommitdiff
path: root/templates/macros/head.html
diff options
context:
space:
mode:
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 %}