feat: make JS light/dark toggle optional

main
welpo 2 years ago
parent d98c0d0bb8
commit 1803987555
No known key found for this signature in database
GPG Key ID: A2F978CF4EC1F5A6

@ -16,6 +16,11 @@ highlight_code = true
highlight_theme = "css" highlight_theme = "css"
[extra] [extra]
# Enable JavaScript theme toggler for dark/light mode (and automatic switching).
# The default setting is the light theme.
theme_switcher = true
# Date format used when listing posts (main page, /blog section, tag posts list…) # Date format used when listing posts (main page, /blog section, tag posts list…)
# Default is "6th July 2049". # Default is "6th July 2049".
long_date_format = "%d %B %Y" long_date_format = "%d %B %Y"

@ -12,12 +12,14 @@
}}</a> }}</a>
{% endfor %} {% endfor %}
</div> </div>
{%- if config.extra.theme_switcher == true -%}
<label class="theme-switcher" for="themeswitch"> <label class="theme-switcher" for="themeswitch">
<input type="checkbox" id="themeswitch"> <input type="checkbox" id="themeswitch">
<div class="switch"> <div class="switch">
<img alt="set dark theme" class="moon" src="{{ config.base_url }}/menu_icon/moon.svg"> <img alt="set dark theme" class="moon" src="{{ config.base_url }}/menu_icon/moon.svg">
<img alt="set light theme" class="sun" src="{{ config.base_url }}/menu_icon/sun.svg"> <img alt="set light theme" class="sun" src="{{ config.base_url }}/menu_icon/sun.svg">
</div> </div>
{%- endif -%}
</label> </label>
</div> </div>
{% endif %} {% endif %}

Loading…
Cancel
Save