Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能适配下gitalk吗QwQ #14

Closed
XuanYuSLF opened this issue Oct 10, 2022 · 4 comments
Closed

能适配下gitalk吗QwQ #14

XuanYuSLF opened this issue Oct 10, 2022 · 4 comments

Comments

@XuanYuSLF
Copy link

No description provided.

@MaLuns
Copy link
Owner

MaLuns commented Oct 10, 2022

没用过这个,你可以先 参考这里 尝试自己添加一下😂,有问题可以找我

@XuanYuSLF
Copy link
Author

我不知道JavaScript放哪😅

@XuanYuSLF
Copy link
Author

@MaLuns
Copy link
Owner

MaLuns commented Oct 11, 2022

简单添加的话参考下面 (🤣盲写的没有实际测试,你可以试试),如果你需要动态加载啥的,可以参考文档里评论集成操作。

添加 CDN 文件

cdn: 
  css:  [//unpkg.com/gitalk/dist/gitalk.css]
  js:
    base: [//unpkg.com/gitalk/dist/gitalk.min.js]

swup: false # 关闭 Pjax

然后修改 themes\async\layout_widget\comment.ejs 文件
添加

<div id="gitalk-container"></div>

<script>
const gitalk = new Gitalk({
  clientID: 'GitHub Application Client ID',
  clientSecret: 'GitHub Application Client Secret',
  repo: 'GitHub repo',      // The repository of store comments,
  owner: 'GitHub repo owner',
  admin: ['GitHub repo owner and collaborators, only these guys can initialize github issues'],
  id: location.pathname,      // Ensure uniqueness and length less than 50
  distractionFreeMode: false  // Facebook-like distraction free mode
})

gitalk.render('gitalk-container')
</script>

然后就是样式适配了,这个就看个人要求了

Repository owner locked and limited conversation to collaborators Oct 11, 2022
@MaLuns MaLuns converted this issue into discussion #18 Oct 11, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants