From 98b8114b3237609ff439a5752e08bac3fc4a624a Mon Sep 17 00:00:00 2001 From: Meekdai Date: Tue, 9 Apr 2024 13:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=96=87=E7=AB=A0=E9=A1=B5?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89ogImage=E5=AD=97=E6=AE=B5=E6=9D=A5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=88=86=E4=BA=AB=E9=A2=84=E8=A7=88=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 默认为avatarUrl --- Gmeek.py | 8 +++++--- templates/post.html | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gmeek.py b/Gmeek.py index 275d2f2..815710b 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -138,9 +138,7 @@ class GMEEK(): postBase["postTitle"]=issue["postTitle"] postBase["postUrl"]=self.blogBase["homeUrl"]+"/"+issue["postUrl"] postBase["description"]=issue["description"] - postBase["createdDate"]=issue["createdDate"] - postBase["author"]=self.blogBase["title"] - postBase["image"]="https://github.com/Meekdai/meekdai.github.io/assets/11755104/b25f48ac-ca50-477c-83ca-c3bdb0b388ab" + postBase["ogImage"]=issue["ogImage"] postBase["postBody"]=post_body postBase["commentNum"]=issue["commentNum"] postBase["style"]=issue["style"] @@ -327,6 +325,10 @@ class GMEEK(): else: self.blogBase[listJsonName][postNum]["script"]=self.blogBase["script"] + if "ogImage" in postConfig: + self.blogBase[listJsonName][postNum]["ogImage"]=postConfig["ogImage"] + else: + self.blogBase[listJsonName][postNum]["ogImage"]=self.blogBase["avatarUrl"] thisTime=datetime.datetime.fromtimestamp(self.blogBase[listJsonName][postNum]["createdAt"]) thisTime=thisTime.astimezone(self.TZ) diff --git a/templates/post.html b/templates/post.html index 9d6d93d..6bd90d2 100644 --- a/templates/post.html +++ b/templates/post.html @@ -6,9 +6,7 @@ - - - + {{ blogBase['postTitle'] }} {% if blogBase['highlight']==1 %}{% endif %} {% endblock %}