Skip to content

Commit

Permalink
fix gitalk
Browse files Browse the repository at this point in the history
  • Loading branch information
qiubaiying committed Dec 19, 2017
1 parent 5c5e317 commit 0cb0996
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
21 changes: 11 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ anchorjs: true # if you want to customize anchor. check

# Gems
# from PR#40, to support local preview for Jekyll 3.0
gems: [jekyll-paginate,jekyll-sitemap]
gems: [jekyll-paginate]



Expand All @@ -57,19 +57,20 @@ kramdown:

# 评论系统
# Disqus(https://disqus.com/)
disqus_username: qiubaiying
# disqus_username: qiubaiying

# Gitalk
# gitalk:
# enable: true #是否开启Gitalk评论
# clientID: 'f2c84e7629bb1446c1a4' #生成的clientID
# clientSecret: '33cdc622139d68dc2273b818d849a348d7ac7ac8' #同上
# repo: qiubaiying.github.io #仓库名称
# owner: qiubaiying #github用户名
# admin: qiubaiying

gitalk:
enable: true #是否开启Gitalk评论
clientID: f2c84e7629bb1446c1a4 #生成的clientID
clientSecret: ca6d6139d1e1b8c43f8b2e19492ddcac8b322d0d #同上
repo: qiubaiying.github.io #仓库名称
owner: qiubaiying #github用户名
admin: qiubaiying
distractionFreeMode: true #是否启用类似FB的阴影遮罩


# 统计

# Analytics settings
# Baidu Analytics
Expand Down
9 changes: 5 additions & 4 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,20 @@ <h2 class="subheading">{{ page.subtitle }}</h2>
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk@latest/dist/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script type="text/javascript">
<script type="text/javascript">
var gitalk = new Gitalk({
clientID: '{{site.gitalk.clientID}}',
clientSecret: '{{site.gitalk.clientSecret}}',
repo: '{{site.gitalk.repo}}',
owner: '{{site.gitalk.owner}}',
admin: ['{{site.gitalk.admin}}'],
id: 'post',
distractionFreeMode: {{site.gitalk.distractionFreeMode}},
id: window.location.pathname,
});
gitalk.render('gitalk-container');
</script>
{% endif %}
<!-- Gitalk end -->
{% endif %}
<!-- Gitalk end -->

{% if site.disqus_username %}
<!-- disqus 评论框 start -->
Expand Down
1 change: 1 addition & 0 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ <h5>Talks</h5>
repo: '{{site.gitalk.repo}}',
owner: '{{site.gitalk.owner}}',
admin: ['{{site.gitalk.admin}}'],
distractionFreeMode: {{site.gitalk.distractionFreeMode}},
id: 'about',
});
gitalk.render('gitalk-container');
Expand Down

0 comments on commit 0cb0996

Please sign in to comment.