Skip to content

Commit

Permalink
showPostSource来配置是否显示github源链接
Browse files Browse the repository at this point in the history
  • Loading branch information
Meekdai committed Jan 29, 2024
1 parent 0d65cfb commit 47a33a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gmeek.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def cleanFile(self):
os.mkdir(self.post_dir)

def defaultConfig(self):
dconfig={"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":"","bottomText":""}
dconfig={"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":"","bottomText":"","showPostSource":1}
config=json.loads(open('config.json', 'r', encoding='utf-8').read())
self.blogBase={**dconfig,**config}.copy()
self.blogBase["postListJson"]=json.loads('{}')
Expand Down
4 changes: 3 additions & 1 deletion templates/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,20 @@
{% block header %}
<h1 class="postTitle">{{ blogBase['postTitle'] }}</h1>
<div class="title-right">

<a href="{{ blogBase['homeUrl'] }}"><button id="buttonHome" class="btn btn-invisible circle" title="{{ i18n['home'] }}">
<svg class="octicon" width="16" height="16">
<path id="pathHome" fill-rule="evenodd" d="{{ IconList['home'] }}"></path>
</svg>
</button></a>

{% if blogBase['showPostSource']==1 %}
<a href="{{ blogBase['postSourceUrl'] }}" target="_blank"><button class="btn btn-invisible circle" title="Issue">
<svg class="octicon" width="16" height="16">
<path id="pathIssue" fill-rule="evenodd" d="{{ IconList['github'] }}"></path>
</svg>
</button></a>
{% endif %}

<button class="btn btn-invisible circle" onclick="modeSwitch();" title="{{ i18n['switchTheme'] }}">
<svg class="octicon" width="16" height="16" >
Expand Down

0 comments on commit 47a33a9

Please sign in to comment.