Simplify theme-mode config
This commit is contained in:
parent
8d4c555638
commit
bb13b52d44
3 changed files with 10 additions and 9 deletions
|
@ -67,16 +67,17 @@ disqus:
|
|||
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
||||
|
||||
|
||||
# Prefer color scheme setting, available values:
|
||||
# Prefer color scheme setting, keep empty will follow the system prefer color by default.
|
||||
# And there will be a toggle to switch the theme between dark and light
|
||||
# on the bottom left of the sidebar.
|
||||
#
|
||||
# dual - Follow the system prefer color by default, and a toggle will display
|
||||
# in the left bottom of Sidebar, which used for switch the theme between dark and light.
|
||||
# Available values:
|
||||
#
|
||||
# light - Use the light color scheme
|
||||
#
|
||||
# dark - Use the dark color scheme
|
||||
#
|
||||
theme_mode: dual
|
||||
theme_mode:
|
||||
|
||||
# boolean type, the global switch for ToC in posts.
|
||||
toc: true
|
||||
|
|
|
@ -52,12 +52,12 @@
|
|||
|
||||
<div class="sidebar-bottom d-flex flex-wrap justify-content-around mt-4">
|
||||
|
||||
{% if site.theme_mode == "dual" %}
|
||||
{% unless site.theme_mode %}
|
||||
<span id="mode-toggle-wrapper">
|
||||
{% include mode-toggle.html %}
|
||||
</span>
|
||||
<span class="icon-border"></span>
|
||||
{% endif %}
|
||||
{% endunless %}
|
||||
|
||||
{% for entry in site.data.contact %}
|
||||
{% capture url %}
|
||||
|
|
|
@ -10,9 +10,9 @@ layout: compress
|
|||
<!DOCTYPE html>
|
||||
|
||||
{% capture prefer_mode %}
|
||||
{% unless site.theme_mode == "dual" %}
|
||||
{% if site.theme_mode %}
|
||||
mode="{{ site.theme_mode }}"
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
|
||||
<html lang="{{ site.lang | split: "_" | first | default: "en" }}" {{ prefer_mode }}>
|
||||
|
|
Loading…
Reference in a new issue