From cd71559564732e4f2b4752560ff1b6de6f737a79 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Wed, 19 Jul 2023 13:32:33 -0700 Subject: nojs configurable default switcher theme --- templates/macros/head.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'templates') 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 %} {%- endif %} {%- endif %} -- cgit v1.3.1