gitment icon indicating copy to clipboard operation
gitment copied to clipboard

hexo博客的gitment评论开启一直失败

Open JJXiangJiaoJun opened this issue 5 years ago • 17 comments

按照教程上配的,我的github pages绑定了个人域名 https//:hongbb.top OAuth配置如下,应该是没有错误的

_config.yml的配置如下,保证client_id 和 client_secret没有填错

comment:
  gitment:
    enable: true
    owner: 'JJXiangJiaoJun' # 必填项, 你的GitHub ID
    repo: 'JJXiangJiaoJun.github.io' # 必填项  你的存储评论的repo
    oauth:
      client_id: 'd7df3d5d159f81371d76' # 必填项
      client_secret: '3794527fca067871d3795782ae7fd14f94ce3a74' # 必填项
      redirect_uri: # 可以填也可以不填

设置后博客上显示 Error: Comments Not Initialized

点击 登录 按钮后,无法跳转到github授权界面 浏览器上信息为 https://hongbb.top/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch

看起来好像是call-back url填错了,不过我试了 原来的URL也没用

JJXiangJiaoJun avatar Jan 18 '19 19:01 JJXiangJiaoJun

作者自己的官方blog一样的问题:Error: Comments Not Initialized

zithan avatar Jan 22 '19 06:01 zithan

我的也是,我是在 hexo d 之后,刷新页面,页面显示Error: Comments Not Initialized,点击Login,然后会跳出对话框[object ProgressEvent],点击确定之后,Gitment区域就显示Logging in... ,会一直持续下去,并且Gitment区域不能操作

puddlejumper26 avatar Jan 24 '19 00:01 puddlejumper26

同样的问题

adangran avatar Feb 07 '19 13:02 adangran

我的也是,昨天弄的,github登陆之后浏览器显示:

[object XMLHttpRequestProgressEvent],然后一直在转圈。。。loading commetns

BlockBB avatar Feb 13 '19 04:02 BlockBB

可以看这里 https://sherry0429.github.io/2019/02/12/gitment%E4%BF%AE%E5%A4%8D/

sherry0429 avatar Feb 14 '19 02:02 sherry0429

可以看这里 https://sherry0429.github.io/2019/02/12/gitment%E4%BF%AE%E5%A4%8D/

你目前博客的gitment就会报object ProgressEven 不知道什么原因,我的icarus也是这种情况

RikkaBlue avatar May 04 '19 08:05 RikkaBlue

我也遇到同样问题了 = =

fireairforce avatar May 21 '19 12:05 fireairforce

解决了吗 我也是一样的问题哎 满脑子很糊涂

kopa-kongpan avatar May 28 '19 03:05 kopa-kongpan

解决方案参考:https://adamhu.github.io/2019/06/GitHub-Pages%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA%E6%B5%81%E7%A8%8B/

adamhu avatar Jun 25 '19 03:06 adamhu

目前网上大部分解决方案都失效了,可以使用下面的方法解决: 打开你的blog本地仓库themes\next\layout_third-party\comments\gitment.ejs将

<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>

修改为:

<link rel="stylesheet" href="https://billts.site/extra_css/gitment.css">
<script src="https://billts.site/js/gitment.js"></script>

上面给出的是gitment汉化版

Chiang97912 avatar Aug 01 '19 09:08 Chiang97912

说一下本人的 解决办法 : 我的github pages绑定了个人域名 https//:hongbb.top 导致重定向一直错误,我只修改了_config.yml 中的 redirect_uri , 就解决了问题,现在使用正常

comment:
  gitment:
    enable: true
    owner: 'JJXiangJiaoJun' # 必填项, 你的GitHub ID
    repo: 'JJXiangJiaoJun.github.io' # 必填项  你的存储评论的repo
    oauth:
      client_id: 'd7df3d5d159f81371d76' # 必填项
      client_secret: '3794527fca067871d3795782ae7fd14f94ce3a74' # 必填项
      redirect_uri: https//:hongbb.top    #如果绑定了个人域名,这里一定要填上绑定的个人域名!!!!!!!!!!!!!

可以试试将redirect_uri 改成自己绑定的个人域名

JJXiangJiaoJun avatar Aug 01 '19 09:08 JJXiangJiaoJun

按照楼上所说的方法,gitment没搞定.换了一个评论系统,gittalk ,https://yunhao.space/2018/07/04/hexo-next-gitalk-comments-tutor/这是教程地址..配置起来很简单..

chuhuilove avatar Aug 04 '19 04:08 chuhuilove

关于不能初始化的问题,我在手机上解决了。这是什么情况?

longxiaojiangi avatar Aug 31 '19 18:08 longxiaojiangi

说一下本人的 解决办法 : 我的github pages绑定了个人域名 https//:hongbb.top 导致重定向一直错误,我只修改了_config.yml 中的 redirect_uri , 就解决了问题,现在使用正常

comment:
  gitment:
    enable: true
    owner: 'JJXiangJiaoJun' # 必填项, 你的GitHub ID
    repo: 'JJXiangJiaoJun.github.io' # 必填项  你的存储评论的repo
    oauth:
      client_id: 'd7df3d5d159f81371d76' # 必填项
      client_secret: '3794527fca067871d3795782ae7fd14f94ce3a74' # 必填项
      redirect_uri: https//:hongbb.top    #如果绑定了个人域名,这里一定要填上绑定的个人域名!!!!!!!!!!!!!

可以试试将redirect_uri 改成自己绑定的个人域名

亲测无效

f20500909 avatar Oct 09 '19 13:10 f20500909

我的gitment 点击login后出现了下面的代码:

> <%- _partial('common/head') %> <%- _partial('common/navbar') %> <% function main_column_class() { switch (column_count()) { case 1: return 'is-12'; case 2: return 'is-8-tablet is-8-desktop is-8-widescreen'; case 3: return 'is-8-tablet is-8-desktop is-6-widescreen' } return ''; } %>
<%- body %>
<%- _partial('common/widget', { position: 'left' }) %> <%- _partial('common/widget', { position: 'right' }) %>
<%- _partial('common/footer') %> <%- _partial('common/scripts') %> <% if (has_config('search.type')) { %> <%- _partial('search/' + get_config('search.type')) %> <% } %>

JeffersonHuang avatar Feb 01 '20 04:02 JeffersonHuang

有人解决这个问题吗,我的gitment也是一直开启不了

janewu66 avatar Aug 09 '21 15:08 janewu66

按照楼上所说的方法,gitment没搞定.换了一个评论系统,gittalk ,[https://yunhao.space/2018/07/04/hexo-next-gitalk-comments-tutor/这是教程地址..配置起来很简单](Car Gameshttps://yunhao.space/2018/07/04/hexo-next-gitalk-comments-tutor/%E8%BF%99%E6%98%AF%E6%95%99%E7%A8%8B%E5%9C%B0%E5%9D%80..%E9%85%8D%E7%BD%AE%E8%B5%B7%E6%9D%A5%E5%BE%88%E7%AE%80%E5%8D%95)..

"Thanks, great blog!"

donkyhote6 avatar Aug 08 '23 05:08 donkyhote6