imsun / gitment

A comment system based on GitHub Issues.
https://imsun.github.io/gitment/
MIT License
4.06k stars 347 forks source link

配置完成后,点击登录,跳转到一个404页面,请问问题出在哪里呢? #79

Open nspangbo opened 6 years ago

GeekaholicLin commented 6 years ago

看控制台报了什么错。估计是url中有特殊符号

nspangbo commented 6 years ago

@GeekaholicLin 本地 hexo g 没有报错, hexo d 后,登录的时候跳转到404页面

nspangbo commented 6 years ago

404页面: https://github.com/login/oauth/authorize?scope=public_repo&redirect_uri=https%3A%2F%2F0xwangbo.github.io%2F2017%2F03%2F22%2FCreate-a-Custom-iOS-Framework-in-Swift%2F%23%25E5%258F%2582%25E8%2580%2583&client_id=&client_secret=

文章: https://0xwangbo.github.io/2017/03/22/Create-a-Custom-iOS-Framework-in-Swift

@GeekaholicLin

GeekaholicLin commented 6 years ago

你还没有进行配置,所以不可以,具体配置方式看readme,而且建议你的script标签放在head标签里面,放在评论框后很有可能会出错。

<script>
        var gitment = new Gitment({
            owner: '',
            repo: '',
            oauth: {
                client_id: '',
                client_secret: '',
            },
        })
        gitment.render('comments')
    </script>
nspangbo commented 6 years ago

<% if (theme.gitment){ %>

<% } %>


gitment: true owner: 0xwangbo repo: https://github.com/0xwangbo/gitment.git client_id: client_secret:

这么做有问题吗

GeekaholicLin commented 6 years ago

看你的主题吧。我的是这样配置的,你可以参考一下:


  var labels = "blog,gitment";
  labels = labels.split(",");
  var gitment = new Gitment({
    id: window.location.pathname,
    owner: "GeekaholicLin",
    repo: "geekaholiclin.github.io",
    oauth: {
      client_id: "aa2215dfc8ee944d1205",
      client_secret: "77cd2afa5d161bc0ab04639ed81300d808c6e22b"
    },
    perPage: "20",
    labels: labels
  });
mowatermelon commented 6 years ago

@0xwangbo 你的写的回调地址好像有问题

#  githubID: #{your-github-name}
#  repo: #{your-github-name}.github.io
#  ClientID: #{your-ClientID}
#  ClientSecret: #{your-ClientSecret}