This action will force synchronization from 恪守/giteement, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
欢迎使用和Star支持,如使用过程中碰到问题,可以提出Issue,我会尽力完善
功能还很少,欢迎各位给我提意见和建议~
本项目源于:https://gitee.com/eillott/giteement。向作者表示深深的敬意。
基于码云的评论系统,主要用于Hexo博客系统中接入基于码云Issues的评论系统。
效果展示 ➡️ https://zhousiwei.gitee.io/
软件是基于gitment的源码开发的。
开发语言:nodeJS
使用码云的issues作为评论系统,就要使用码云来登录评论,所以需要在码云上配置第三方应用。
注册一个新的第三方应用 ➡️ https://gitee.com/oauth/applications/new
issues
、notes
_config.yml
giteement:
enable: true # 是否启用码云评论系统
# 是否使用官方js(false可以提升访问速度)
remote: false
redirect_uri: https://zhousiwei.gitee.io/yilia-plus-demo # 应用回调地址(请和配置的第三方应用保持一致)
# 不能更改(网上开源项目https://github.com/Rob--W/cors-anywhere作者提供的专门用来跨域服务器的配置)
oauth_uri: https://cors-anywhere.herokuapp.com/https://gitee.com/oauth/token
giteeID: zhousiwei # 你的码云账号英文名
# 存储评论的 repo
repo: yilia-plus-demo
gitment_oauth:
client_id: '*********' #client ID
client_secret: '*********' #client secret
hexo s -g
hexo-theme-yilia-plus配置Demo ➡️ https://gitee.com/zhousiwei/yilia-plus-demo
themes/landscape/layout/index.ejs
文件themes/landscape/layout/_partial/article.ejs
文件<% if (!index && post.comments && theme.giteement && theme.giteement.enable){ %>
<div id="giteement-ctn"></div>
<% if (theme.giteement && theme.giteement.remote){ %>
<!-- <link rel="stylesheet" href="https://giteement.oss-cn-beijing.aliyuncs.com/wd-discuss.css"> -->
<!-- <script src="https://giteement.oss-cn-beijing.aliyuncs.com/discuss_hexo.js"></script> -->
<link rel="stylesheet" href="https://giteement.oss-cn-beijing.aliyuncs.com/default.css">
<script src="https://giteement.oss-cn-beijing.aliyuncs.com/giteement.browser.js"></script>
<% } else { %>
<link rel="stylesheet" href="<%=config.root%>assets/default.css">
<script src="<%=config.root%>assets/giteement.browser.js"></script>
<% } %>
<script>
var giteement = new Giteement({
id: '<%=page.date.format('YYYYMMDDHHmmss')%>',
owner: '<%=theme.giteement.giteeID%>',
repo: '<%=theme.giteement.repo%>',
backcall_uri: '<%=theme.giteement.redirect_uri%>',
oauth_uri: '<%=theme.giteement.oauth_uri%>',
oauth: {
client_id: '<%=theme.giteement.gitment_oauth.client_id%>',
client_secret: '<%=theme.giteement.gitment_oauth.client_secret%>'
},
})
giteement.render('giteement-ctn')
</script>
<% } %>
themes/next/layout/index.swig
文件themes/next/layout/_partials/comments.swig
文件把
theme.giteement.ClientID
和theme.giteement.ClientSecret
改为theme.giteement.gitment_oauth.client_id
和theme.giteement.gitment_oauth.client_secret
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。