XPoet / hexo-theme-keep

:rainbow: A simple and light theme for Hexo. It makes you more focused on writing.
https://xpoet.cn
GNU Affero General Public License v3.0
1.35k stars 183 forks source link

Related Issues not found Please contact @someone to initialize the comment #87

Closed chargerKong closed 3 years ago

chargerKong commented 3 years ago

我想要搞一个gitalk的插件.

目前的情况:评论的地方显示Related Issues not found Please contact @someone to initialize the comment,可以点击这里查看。关键是我已经发出了一个issue了,点击这里查看

下面是配置文件

comment:
  enable: true
  use: gitalk  # values: valine | gitalk | twikoo

  # Valine
  # See: https://github.com/xCss/Valine
  valine:
    appid:                # your leancloud application appid
    appkey:               # your leancloud application appkey
    placeholder:          # your placeholder

  # Gitalk
  # See: https://github.com/gitalk/gitalk
  gitalk:
    github_id: chargerKong            # GitHub repo owner
    repository: hexo-site-comment           # Repository name to store issues
    client_id: c5dbc1ec7a344c74d1c3            # GitHub Application Client ID
    client_secret: 52930774138aee27eea54a7257d2074609c0aac         # GitHub Application Client Secret

谢谢各位大佬!!

XPoet commented 3 years ago

@chargerKong

你网站的 gitalk 样式没加载出来

image

重新编译再部署一次。

先执行 hexo clean 清除 Hexo 缓存,再执行 hexo g 生成静态文件

XPoet commented 3 years ago

image

这是有的 CSS 样式的 Gitalk 评论系统界面


你需要用你自己的 GitHub 账号登录一下,才能完成初始化创建,成功创建后你的仓库中会生成一条新 Issue

每篇文章都需要登录一下才能创建对应文章的 Issue

XPoet commented 3 years ago

这个网站 https://keep.xpoet.cn/ 就用到 Gitalk,你打开看一下每篇文章下面的评论研究一下就明白了

chargerKong commented 3 years ago

谢谢!@XPoet 我现在有了 CSS 样式的 Gitalk 评论系统界面了。 但是很奇怪,我点击了GitHub登记之后就会返回主界面。


你的意思是说我在这个界面点击登录完成初始化创建,而不是手动去github创建一个是吗?

XPoet commented 3 years ago

@chargerKong

  1. 在本地启动的 Hexo,gitalk 登录后会直接返回到主界面。那是因为本地 http://localhost/xxxx 跟你创建的 OAuth App 时填写的域名不一致造成的。 这个不影响,成功部署后就能正常使用了。

  2. 是的,每篇文章都需要登录一下,手动初始化才能生成对应文章评论的 issue。具体你可以去查阅 gitalk 官方文档,我比较少用,不是很清楚

chargerKong commented 3 years ago

我之前是deploy之后也会跳转到主界面,现在好了 原来是我在建立OAuth Apps填写地址的时候,https写错为http了!! 谢谢~

everfu commented 1 year ago

说一下,这个项目源码里用到了一个cloudflare的worker,由于被cfw和谐了,所以一直请求不到,导致在国内无法初始化

https://[cors-anywhere.azm.workers.dev](https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token)/https://github.com/login/oauth/access_token

由于.worker.dev被和谐了,这里是请求不到的

POST https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token net::ERR_CONNECTION_TIMED_OUT
(anonymous) @ xhr.js:178
e.exports @ xhr.js:12
e.exports @ dispatchRequest.js:50
Promise.then (async)
a.request @ Axios.js:61
a.<computed> @ Axios.js:86
(anonymous) @ bind.js:9
t @ gitalk.jsx:101
P @ preact.js:212
T @ preact.js:326
v @ preact.js:134
g @ preact.js:110
z @ preact.js:363
o @ preact-compat.es.js:149
value @ index.js:28
initGitalk @ index.html?code=
Promise.then (async)
loadGitalk @ index.html?code=
(anonymous) @ index.html?code=
whiteRabbit-me commented 1 year ago

gitalk: enable: true autoExpand: true clientID: '1d4449a3eeabd69d9358' clientSecret: '507aa31fbcde2e460169ffd927e2e3716e286de7' repo: 'whiteRabbit-me.github.io' owner: 'whiteRabbit-me' admin: ['whiteRabbit-me'] id: uid language: cn distractionFreeMode: true recentComment: true proxy: '' 这个配置有错吗 点击登录后是404