From c8e4149792530a5de2fb6a26b01a5c14317d7769 Mon Sep 17 00:00:00 2001 From: jeffreytse Date: Sat, 10 Oct 2020 14:13:34 +0800 Subject: feat: add config option for night mode --- _config.yml | 4 ++++ _includes/extensions/theme-toggle.html | 29 +++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/_config.yml b/_config.yml index f8d98f7..5833722 100644 --- a/_config.yml +++ b/_config.yml @@ -78,6 +78,10 @@ yat: # Custom color as below: # theme_color: "#882250" +# Night mode, default is "auto", "auto" is for auto nightshift (19:00 - 07:00), +# "mannual" is for mannual toggle, and "on/off" is for always on/off. +# night_mode: "auto" + # If you want to link only specific pages in your header, uncomment # this and add the path to the pages in order as they should show up # header_pages: diff --git a/_includes/extensions/theme-toggle.html b/_includes/extensions/theme-toggle.html index 7976e21..d426f65 100644 --- a/_includes/extensions/theme-toggle.html +++ b/_includes/extensions/theme-toggle.html @@ -9,6 +9,10 @@ +{%- assign name = 'night_mode' -%} +{%- include functions.html func='get_value' default='auto' -%} +{%- assign night_mode = return -%} + -- cgit v1.2.3