自定义文章字体大小
[comment]: # (##{"fontSize":“20px”}##)
This commit is contained in:
parent
abba6eb097
commit
04acc85a9a
2
Gmeek.js
2
Gmeek.js
@ -147,6 +147,8 @@ else{
|
||||
document.getElementById("pathHome").setAttribute("d",value=IconList["home"]);
|
||||
document.getElementById("pathIssue").setAttribute("d",value=IconList["github"]);
|
||||
|
||||
if(blogBase["fontSize"]!=""){document.getElementById("postBody").setAttribute("style","font-size:"+blogBase["fontSize"])}
|
||||
|
||||
if(blogBase["commentNum"]>0){
|
||||
cmButton=document.getElementById("cmButton");
|
||||
span=document.createElement("span");
|
||||
|
||||
13
Gmeek.py
13
Gmeek.py
@ -82,6 +82,7 @@ class GMEEK():
|
||||
postBase["startSite"]=self.blogBase["startSite"]
|
||||
postBase["i18n"]=self.blogBase["i18n"]
|
||||
postBase["commentNum"]=issue["commentNum"]
|
||||
postBase["fontSize"]=issue["fontSize"]
|
||||
postBase["repoName"]=options.repo_name
|
||||
postBase["GMEEK_VERSION"]=options.Gmeek_version
|
||||
|
||||
@ -139,10 +140,18 @@ class GMEEK():
|
||||
self.blogBase["postListJson"][postNum]["description"]=issue.body.split(period)[0]+period
|
||||
|
||||
try:
|
||||
modifyTime=json.loads(issue.body.split("\r\n")[-1:][0].split("##")[1])
|
||||
self.blogBase["postListJson"][postNum]["createdAt"]=modifyTime["timestamp"]
|
||||
postConfig=json.loads(issue.body.split("\r\n")[-1:][0].split("##")[1])
|
||||
except:
|
||||
postConfig={}
|
||||
|
||||
if "timestamp" in postConfig:
|
||||
self.blogBase["postListJson"][postNum]["createdAt"]=postConfig["timestamp"]
|
||||
else:
|
||||
self.blogBase["postListJson"][postNum]["createdAt"]=int(time.mktime(issue.created_at.timetuple()))
|
||||
if "fontSize" in postConfig:
|
||||
self.blogBase["postListJson"][postNum]["fontSize"]=str(postConfig["fontSize"])
|
||||
else:
|
||||
self.blogBase["postListJson"][postNum]["fontSize"]=""
|
||||
|
||||
thisYear=datetime.datetime.fromtimestamp(self.blogBase["postListJson"][postNum]["createdAt"]).year
|
||||
self.blogBase["postListJson"][postNum]["dateLabelColor"]=self.blogBase["yearColorList"][int(thisYear)%len(self.blogBase["yearColorList"])]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user