Closed XuanYuSLF closed 1 year ago
我不知道JavaScript放哪😅
简单添加的话参考下面 (🤣盲写的没有实际测试,你可以试试),如果你需要动态加载啥的,可以参考文档里评论集成操作。
添加 CDN 文件
cdn:
css: [//unpkg.com/gitalk/dist/gitalk.css]
js:
base: [//unpkg.com/gitalk/dist/gitalk.min.js]
swup: false # 关闭 Pjax
然后修改 themes\async\layout_widget\comment.ejs 文件 添加
<div id="gitalk-container"></div>
<script>
const gitalk = new Gitalk({
clientID: 'GitHub Application Client ID',
clientSecret: 'GitHub Application Client Secret',
repo: 'GitHub repo', // The repository of store comments,
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>
然后就是样式适配了,这个就看个人要求了
没用过这个,你可以先 参考这里 尝试自己添加一下😂,有问题可以找我