文章页自定义style
[comment]: # (##{"style":“<style>#postBody{font-size:20px}</style>”}##)
This commit is contained in:
parent
9d852ee859
commit
4aa6d04d4b
8
Gmeek.py
8
Gmeek.py
@ -103,7 +103,7 @@ class GMEEK():
|
|||||||
postBase["startSite"]=self.blogBase["startSite"]
|
postBase["startSite"]=self.blogBase["startSite"]
|
||||||
postBase["i18n"]=self.blogBase["i18n"]
|
postBase["i18n"]=self.blogBase["i18n"]
|
||||||
postBase["commentNum"]=issue["commentNum"]
|
postBase["commentNum"]=issue["commentNum"]
|
||||||
postBase["fontSize"]=issue["fontSize"]
|
postBase["style"]=issue["style"]
|
||||||
postBase["script"]=issue["script"]
|
postBase["script"]=issue["script"]
|
||||||
postBase["top"]=issue["top"]
|
postBase["top"]=issue["top"]
|
||||||
postBase["repoName"]=options.repo_name
|
postBase["repoName"]=options.repo_name
|
||||||
@ -189,10 +189,10 @@ class GMEEK():
|
|||||||
self.blogBase["postListJson"][postNum]["createdAt"]=postConfig["timestamp"]
|
self.blogBase["postListJson"][postNum]["createdAt"]=postConfig["timestamp"]
|
||||||
else:
|
else:
|
||||||
self.blogBase["postListJson"][postNum]["createdAt"]=int(time.mktime(issue.created_at.timetuple()))
|
self.blogBase["postListJson"][postNum]["createdAt"]=int(time.mktime(issue.created_at.timetuple()))
|
||||||
if "fontSize" in postConfig:
|
if "style" in postConfig:
|
||||||
self.blogBase["postListJson"][postNum]["fontSize"]=str(postConfig["fontSize"])
|
self.blogBase["postListJson"][postNum]["style"]=str(postConfig["style"])
|
||||||
else:
|
else:
|
||||||
self.blogBase["postListJson"][postNum]["fontSize"]=""
|
self.blogBase["postListJson"][postNum]["style"]=""
|
||||||
if "script" in postConfig:
|
if "script" in postConfig:
|
||||||
self.blogBase["postListJson"][postNum]["script"]=str(postConfig["script"])
|
self.blogBase["postListJson"][postNum]["script"]=str(postConfig["script"])
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -17,6 +17,8 @@ h1 a:not([href]){color:inherit;text-decoration:none;vertical-align: bottom;font-
|
|||||||
.g-emoji{font-size:24px;}
|
.g-emoji{font-size:24px;}
|
||||||
@media (max-width: 767px) {body {padding: 8px;}}
|
@media (max-width: 767px) {body {padding: 8px;}}
|
||||||
</style>
|
</style>
|
||||||
|
{{ blogBase['style'] }}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<h1>
|
<h1>
|
||||||
@ -56,10 +58,6 @@ h1 a:not([href]){color:inherit;text-decoration:none;vertical-align: bottom;font-
|
|||||||
{% block script %}
|
{% block script %}
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
{% if blogBase['fontSize']!="" -%}
|
|
||||||
document.getElementById("postBody").setAttribute("style","font-size:{{ blogBase['fontSize'] }}");
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{% if blogBase['commentNum']>0 -%}
|
{% if blogBase['commentNum']>0 -%}
|
||||||
cmButton=document.getElementById("cmButton");
|
cmButton=document.getElementById("cmButton");
|
||||||
span=document.createElement("span");
|
span=document.createElement("span");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user