diff --git a/Gmeek.py b/Gmeek.py index d79fae9..80ed285 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -74,14 +74,13 @@ class GMEEK(): os.mkdir(self.post_dir) if os.path.exists(self.static_dir): - target_static_dir = os.path.join(self.root_dir, 'static') - shutil.copytree(self.static_dir, target_static_dir) + shutil.copytree(self.static_dir, os.path.join(self.root_dir, 'static')) print("Copy static to docs") else: print("static not exist") def defaultConfig(self): - 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":"","indexScript":"","indexStyle":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence","exlink":{}} + 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":"","indexScript":"","indexStyle":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence","exlink":{},"needComment":1} 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/post.html b/templates/post.html index 6676904..e60270e 100644 --- a/templates/post.html +++ b/templates/post.html @@ -57,8 +57,10 @@ {% block content %}
{{ blogBase['postBody'] }}
{{ blogBase['bottomText'] }}
+{% if blogBase['needComment']==1 %}
+{% endif %} {% endblock %} {% block script %} @@ -72,6 +74,8 @@ document.getElementById("pathIssue").setAttribute("d",IconList["github"]); span.innerHTML="{{ blogBase['commentNum'] }}"; cmButton.appendChild(span); {%- endif %} + +{% if blogBase['needComment']==1 %} function openComments(){ cm=document.getElementById("comments"); cmButton=document.getElementById("cmButton"); @@ -109,6 +113,7 @@ function iFrameLoading(){ } } } +{%- endif %} {{ blogBase['script'] }} {% endblock %}