Skip to content

Commit

Permalink
add posts
Browse files Browse the repository at this point in the history
  • Loading branch information
yuantianchi committed Oct 12, 2018
1 parent 01c11ed commit 1a2a571
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,29 @@ <h5>FRIENDS</h5>
</div>
</article>


<!--Gitalk评论start -->
{% if site.gitalk.enable %}
<!-- 引入Gitalk评论插件 -->
<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>
<!-- 引入一个生产md5的js,用于对id值进行处理,防止其过长 -->
<!-- Thank DF:https://github.com/NSDingFan/NSDingFan.github.io/issues/3#issuecomment-407496538 -->
<script src="{{ site.baseurl }}/js/md5.min.js"></script>
<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}}'],
distractionFreeMode: {{site.gitalk.distractionFreeMode}},
id: md5(location.pathname),
});
gitalk.render('gitalk-container');
</script>
{% endif %}
<!-- Gitalk end -->
{% if site.anchorjs %}
<!-- async load function -->
<script>
Expand Down Expand Up @@ -170,24 +192,3 @@ <h5>FRIENDS</h5>
</style>
{% endif %}

<!-- Gitalk 评论 start -->
{% if site.gitalk.enable %}
<!-- Gitalk link -->
<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">
var gitalk = new Gitalk({
clientID: '{{site.gitalk.clientID}}',
clientSecret: '{{site.gitalk.clientSecret}}',
repo: '{{site.gitalk.repo}}',
owner: '{{site.gitalk.owner}}',
admin: ['{{site.gitalk.admin}}'],
distractionFreeMode: {{site.gitalk.distractionFreeMode}},
id: 'about',
});
gitalk.render('gitalk-container');
</script>
{% endif %}
<!-- Gitalk end -->

0 comments on commit 1a2a571

Please sign in to comment.