From 4d9fe5ac8f1b2b49c3afbb536610ab5db195da23 Mon Sep 17 00:00:00 2001 From: Meekdai Date: Mon, 1 Jul 2024 16:49:30 +0800 Subject: [PATCH] =?UTF-8?q?needComment=E7=94=A8=E4=BA=8E=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E8=AF=84=E8=AE=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gmeek.py | 5 ++--- templates/post.html | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) 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 %}