diff --git a/CONIFG.md b/CONIFG.md
index 128c687..040fb13 100644
--- a/CONIFG.md
+++ b/CONIFG.md
@@ -12,14 +12,7 @@
"homeUrl":"http://blog.meekdai.com",
"avatarUrl":"http://meekdai.com/avatar.jpg",
"faviconUrl":"http://meekdai.com/favicon.ico",
- "email":"meekdai@163.com",
- "startSite":"02/16/2015",
- "filingNum":"浙ICP备20023628号",
- "onePageListNum":15,
"singlePage":["link","about"],
- "commentLabelColor":"#006b75",
- "yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],
- "i18n":"CN",
"GMEEK_VERSION":"v2.3"
}
```
diff --git a/Gmeek.py b/Gmeek.py
index 46fa37c..e206150 100644
--- a/Gmeek.py
+++ b/Gmeek.py
@@ -43,18 +43,9 @@ class GMEEK():
self.labelColorDict=json.loads('{}')
for label in self.repo.get_labels():
self.labelColorDict[label.name]='#'+label.color
-
print(self.labelColorDict)
- config=json.loads(open('config.json', 'r', encoding='utf-8').read())
- self.blogBase=config.copy()
- self.blogBase["postListJson"]=json.loads('{}')
- self.blogBase["singeListJson"]=json.loads('{}')
-
- if self.blogBase["i18n"]=="CN":
- self.i18n=i18nCN
- else:
- self.i18n=i18n
+ self.defaultConfig()
def cleanFile(self):
if os.path.exists(self.backup_dir):
@@ -67,6 +58,17 @@ class GMEEK():
os.mkdir(self.root_dir)
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"}
+ config=json.loads(open('config.json', 'r', encoding='utf-8').read())
+ self.blogBase={**dconfig,**config}.copy()
+ self.blogBase["postListJson"]=json.loads('{}')
+ self.blogBase["singeListJson"]=json.loads('{}')
+ if self.blogBase["i18n"]=="CN":
+ self.i18n=i18nCN
+ else:
+ self.i18n=i18n
+
def get_repo(self,user:Github, repo:str):
return user.get_repo(repo)
diff --git a/templates/base.html b/templates/base.html
index 22370a7..f9c9282 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -8,8 +8,8 @@
{% block head %}{% endblock %}
@@ -46,13 +46,13 @@ else if(localStorage.getItem("meek_theme")=="dark"){changeDark();}
else if(localStorage.getItem("meek_theme")=="light"){changeLight();}
function changeDark(){
- document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="dark";
+ document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="{{ blogBase['nightTheme'] }}";
document.getElementById("themeSwitch").setAttribute("d",value=IconList["moon"]);
document.getElementById("themeSwitch").parentNode.style.color="#00f0ff";
if(utterancesLoad==1){utterancesTheme("dark-blue");}
}
function changeLight(){
- document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="light";
+ document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="{{ blogBase['dayTheme'] }}";
document.getElementById("themeSwitch").setAttribute("d",value=IconList["sun"]);
document.getElementById("themeSwitch").parentNode.style.color="#ff5000";
if(utterancesLoad==1){utterancesTheme("github-light");}