添加文章页自定义html标签

##{"html":""}##
This commit is contained in:
Meekdai 2024-05-28 18:13:41 +08:00
parent be545404f2
commit 88e434cb26

View File

@ -8,6 +8,7 @@ import shutil
import urllib
import requests
import argparse
import html
from github import Github
from xpinyin import Pinyin
from feedgen.feed import FeedGenerator
@ -158,6 +159,9 @@ class GMEEK():
f'color: var(--fgColor-{style},var(--color-{style}-fg));}}</style>'
)
if '##{"html":' in post_body:
post_body=re.sub(r'##\{"html":"(.*?)"\}##',lambda x: html.unescape(x.group(1)),post_body,flags=re.DOTALL)
postBase["postTitle"]=issue["postTitle"]
postBase["postUrl"]=self.blogBase["homeUrl"]+"/"+issue["postUrl"]
postBase["description"]=issue["description"]