From 6e8e04c634e5c32be13db87ce7ac6b968674e2b5 Mon Sep 17 00:00:00 2001 From: Meekdai Date: Tue, 2 Apr 2024 11:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87themeMode=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 目前默认为manual,另外可选跟随系统auto,和固定主题fix --- Gmeek.py | 2 +- templates/base.html | 7 ++++++- templates/plist.html | 2 +- templates/post.html | 9 +++++++-- templates/tag.html | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Gmeek.py b/Gmeek.py index f3fb96f..777f8e6 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -71,7 +71,7 @@ class GMEEK(): os.mkdir(self.post_dir) def defaultConfig(self): - dconfig={"singlePage":[],"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence"} + dconfig={"singlePage":[],"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","themeMode":"manual","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence"} config=json.loads(open('config.json', 'r', encoding='utf-8').read()) self.blogBase={**dconfig,**config}.copy() self.blogBase["postListJson"]=json.loads('{}') diff --git a/templates/base.html b/templates/base.html index 400c214..b7eff30 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,16 +1,18 @@ - + + {%- if blogBase['themeMode']=='manual' -%} + {%- endif -%} {% block head %}{% endblock %}