『开发技巧』解决hexo gitment 的object ProgressEvent问题,汉化等问题

2022-03-07 14:05:21 浏览数 (2)

添加gitment评论 解决object ProgressEvent,汉化等问题

找到主题目录下的相关 ejs文件内容:

代码语言:javascript复制
<div id="comment-container"></div>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
	var gitment = new Gitment({
		id: '<%= md5(page.path) %>',
		owner: '<%= get_config('comment.owner') %>',
		repo: '<%= get_config('comment.repo') %>',
		oauth: {
			client_id: '<%= get_config('comment.client_id') %>',
			client_secret: '<%= get_config('comment.client_secret') %>',
		},
	})
	gitment.render('comment-container')
</script>

将以下内容:

代码语言:javascript复制
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>

改为:

代码语言:javascript复制
<link rel="stylesheet" href="https://billts.site/extra_css/gitment.css">
<script src="https://billts.site/js/gitment.js"></script>

演示界面如下:http://deepmiss.cn/2019/09/07/Icarus_quick_start/

0 人点赞