github-comments
github-comments copied to clipboard
再此留下你对 github-comments 的评论
这里的所有留言都会在 http://nimojs.github.io/github-comments/ 显示
复制下面的代码到你的网站即可使用
<style>
.gc-comments {font-size: 12px;}
</style>
<script src="https://unpkg.com/[email protected]/gc.js"></script>
<div class="gc-comments" data-repos="nimojs/github-comments" data-issues="1" >
<div class="gc-comments-title">
评论
</div>
<div class="gc-comments-info">
想在此留下评论,请访问 <a href="issues_link">issues_link</a> 提交评论
</div>
</div>
将 data-repos="nimojs/github-comments"
data-issues="1"
修改为你的 github 地址和 issues 编号
<!--
script 最终请替换为
<script src="https://unpkg.com/github-comments@{版本号}/gc.js" ></script>
比如
<script src="https://unpkg.com/[email protected]/gc.js" ></script>
-->
这里的所有留言都会在 http://nimojs.github.io/github-comments/ 显示
gc.load()
gc.load(repos, issues, element)
参数 | 说明 | 示例 |
---|---|---|
repos | 项目地址 | nimojs/blog |
issues | issues id | 2 |
element | 渲染容器 | "#demo" document.getElementById('demo') $('#demo') |
<div id="demo"></div>
<script src="http://nimojs.github.io/github-comments/gc.js" ></script>
<script>
gc.load('nimojs/blog', 2, '#demo')
</script>
<!--
script 最终请替换为
<script src="https://unpkg.com/github-comments@{版本号}/gc.js" ></script>
比如
<script src="https://unpkg.com/[email protected]/gc.js" ></script>
-->
占位
占位
test
test
试试
新人报道~
测试
nice! @nimojs 你可研究研究这个仓库commentit 看起来很拽的样子,可以直接在网站上面留言.... https://commentit.io/
@jaywcjlove
感谢分享,commentit 不与issues关联数据保存在 .yml
文件中。
本项目会一直与 github issues 绑定,这样评论后 github 会推送消息给评论者的关注者。这样能更广泛的传播。
github 不知有这样的借口没有,你应该把留言窗口也放到网站上。这样比较nice,同样达到了你想要的效果。
@jaywcjlove 不错!如果不需要授权用类似 iframe 的方式评论就最好了。
授权肯定是要的。 你要是吧这功能做了,这个仓库肯定能火 1000+star 😄 @nimojs
@nimojs 哥哥啊,你应该把你的js 打个版本,不然我都不敢用,那天你js 变了,我的网站就坏了😄,或者找个cdn
比如我的JSLite 这里就有CDN https://cdnjs.com/libraries/jslite
@jaywcjlove
感谢反馈
awesome 谢谢
@jaywcjlove 已替换为 unpkg
测试!
test
666
沒明白怎麼使用到自己的rep
@wjf444128852
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<style>
.gc-comments {font-size: 12px;}
</style>
<script src="https://unpkg.com/[email protected]/gc.js"></script>
<div class="gc-comments" data-repos="wjf444128852/Button-Hover-Effects" data-issues="1" >
<div class="gc-comments-title">
评论
</div>
<div class="gc-comments-info">
想在此留下评论,请访问 <a href="issues_link">issues_link</a> 提交评论
</div>
</div>
</body>
</html>
@nimojs 这原理是什么?跨域请求所有的数据?
@wjf444128852 https://github.com/nimojs/github-comments/blob/gh-pages/lib/index.js 看源码 github有获取指定issue的http接口
厉害!!!
好像在GitPage里面没法实现 是不是Github做了什么限制 小白用户路过
eeeeeeeeeeeeeee
试一下~