✨ feat: make JS light/dark toggle optional
This commit is contained in:
parent
d98c0d0bb8
commit
1803987555
@ -16,6 +16,11 @@ highlight_code = true
|
||||
highlight_theme = "css"
|
||||
|
||||
[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…)
|
||||
# Default is "6th July 2049".
|
||||
long_date_format = "%d %B %Y"
|
||||
|
@ -12,12 +12,14 @@
|
||||
}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{%- if config.extra.theme_switcher == true -%}
|
||||
<label class="theme-switcher" for="themeswitch">
|
||||
<input type="checkbox" id="themeswitch">
|
||||
<div class="switch">
|
||||
<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">
|
||||
</div>
|
||||
{%- endif -%}
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user