Cloud2016
照它写的来吧
- https://github.com/rbind/xiangyun/blob/master/layouts/partials/head_custom.html 里加入
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
2.另存https://github.com/rbind/xiangyun/blob/master/themes/hugo-xmag/layouts/partials/comments.html
到https://github.com/rbind/xiangyun/tree/master/layouts/partials,然后添加
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: 'GitHub Application Client ID',
clientSecret: 'GitHub Application Client Secret',
repo: 'GitHub repo',
owner: 'GitHub repo owner',
admin: ['GitHub repo owner and collaborators, only these guys can initialize github issues'],
id: location.pathname, // Ensure uniqueness and length less than 50
distractionFreeMode: false // Facebook-like distraction free mode
})
gitalk.render('gitalk-container')
</script>
也可以把上面js部分单独保存为.js人,然后替换为<script src="xxx.js"></script>