✨ 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"
|
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…
x
Reference in New Issue
Block a user