From aaf6d1670f2c4c57f479fab31d05fa2f3873b9bb Mon Sep 17 00:00:00 2001 From: Meekdai Date: Tue, 9 Apr 2024 13:45:29 +0800 Subject: [PATCH] =?UTF-8?q?ogImage=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=B0=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gmeek.py | 6 +++++- templates/plist.html | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Gmeek.py b/Gmeek.py index 815710b..774fc7b 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -84,6 +84,9 @@ class GMEEK(): if "faviconUrl" not in self.blogBase: self.blogBase["faviconUrl"]=self.blogBase["avatarUrl"] + if "ogImage" not in self.blogBase: + self.blogBase["ogImage"]=self.blogBase["avatarUrl"] + if "homeUrl" not in self.blogBase: if str(self.repo.name) == (str(self.repo.owner.login)+".github.io"): self.blogBase["homeUrl"] = f"https://{self.repo.name}" @@ -328,7 +331,7 @@ class GMEEK(): if "ogImage" in postConfig: self.blogBase[listJsonName][postNum]["ogImage"]=postConfig["ogImage"] else: - self.blogBase[listJsonName][postNum]["ogImage"]=self.blogBase["avatarUrl"] + self.blogBase[listJsonName][postNum]["ogImage"]=self.blogBase["ogImage"] thisTime=datetime.datetime.fromtimestamp(self.blogBase[listJsonName][postNum]["createdAt"]) thisTime=thisTime.astimezone(self.TZ) @@ -433,6 +436,7 @@ for i in blog.blogBase["postListJson"]: del blog.blogBase["postListJson"][i]["script"] del blog.blogBase["postListJson"][i]["style"] del blog.blogBase["postListJson"][i]["top"] + del blog.blogBase["postListJson"][i]["ogImage"] if 'commentNum' in blog.blogBase["postListJson"][i]: commentNumSum=commentNumSum+blog.blogBase["postListJson"][i]["commentNum"] diff --git a/templates/plist.html b/templates/plist.html index 6dd2d1c..d607273 100644 --- a/templates/plist.html +++ b/templates/plist.html @@ -1,6 +1,11 @@ {% extends 'base.html' %} {% block head %} + + + + + {{ blogBase['title'] }} {% endblock %}