From 2a93089d72b8ae32d2de6cdd16ceb44c8c0d546b Mon Sep 17 00:00:00 2001 From: Meekdai Date: Thu, 14 Dec 2023 22:03:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=80=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E9=A1=B5script=E5=92=8Cstyle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gmeek.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Gmeek.py b/Gmeek.py index cf3ff5c..ea36e0f 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -59,7 +59,7 @@ class GMEEK(): os.mkdir(self.post_dir) def defaultConfig(self): - dconfig={"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin"} + dconfig={"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":""} config=json.loads(open('config.json', 'r', encoding='utf-8').read()) self.blogBase={**dconfig,**config}.copy() self.blogBase["postListJson"]=json.loads('{}') @@ -244,14 +244,16 @@ class GMEEK(): self.blogBase[listJsonName][postNum]["createdAt"]=postConfig["timestamp"] else: self.blogBase[listJsonName][postNum]["createdAt"]=int(time.mktime(issue.created_at.timetuple())) + if "style" in postConfig: - self.blogBase[listJsonName][postNum]["style"]=str(postConfig["style"]) + self.blogBase[listJsonName][postNum]["style"]=self.blogBase["style"]+str(postConfig["style"]) else: - self.blogBase[listJsonName][postNum]["style"]="" + self.blogBase[listJsonName][postNum]["style"]=self.blogBase["style"] + if "script" in postConfig: - self.blogBase[listJsonName][postNum]["script"]=str(postConfig["script"]) + self.blogBase[listJsonName][postNum]["script"]=self.blogBase["script"]+str(postConfig["script"]) else: - self.blogBase[listJsonName][postNum]["script"]="" + self.blogBase[listJsonName][postNum]["script"]=self.blogBase["script"] thisTime=datetime.datetime.fromtimestamp(self.blogBase[listJsonName][postNum]["createdAt"]) thisYear=thisTime.year