没有代码高亮需求的文章不加载高亮CSS

This commit is contained in:
Meekdai 2023-09-05 22:11:23 +08:00
parent a447a824d8
commit 2915079ab3
2 changed files with 6 additions and 1 deletions

View File

@ -94,6 +94,11 @@ class GMEEK():
post_body=self.markdown2html(f.read())
f.close()
if "highlight" in post_body:
postBase["highlight"]=1
else:
postBase["highlight"]=0
postBase=self.blogBase.copy()
postBase["postTitle"]=issue["postTitle"]
postBase["postBody"]=post_body

View File

@ -2,7 +2,7 @@
{% block head %}
<title>{{ blogBase['postTitle'] }}</title>
<link href="//unpkg.com/@wooorm/starry-night@2.1.1/style/both.css" rel="stylesheet" />
{% if blogBase['highlight']==1 %}<link href="//unpkg.com/@wooorm/starry-night@2.1.1/style/both.css" rel="stylesheet" />{% endif %}
{% endblock %}
{% block style %}