github-comments icon indicating copy to clipboard operation
github-comments copied to clipboard

再此留下你对 github-comments 的评论

Open nimoc opened this issue 9 years ago • 30 comments

这里的所有留言都会在 http://nimojs.github.io/github-comments/ 显示

nimoc avatar Nov 09 '15 16:11 nimoc

复制下面的代码到你的网站即可使用

<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>
-->

nimoc avatar Nov 09 '15 16:11 nimoc

这里的所有留言都会在 http://nimojs.github.io/github-comments/ 显示

nimoc avatar Nov 10 '15 09:11 nimoc

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>
-->

nimoc avatar Nov 10 '15 11:11 nimoc

占位

nimoc avatar Nov 10 '15 11:11 nimoc

占位

nimoc avatar Nov 10 '15 11:11 nimoc

test

joway avatar Feb 16 '16 09:02 joway

test

marszk avatar Mar 30 '16 09:03 marszk

试试

jiucheng-front avatar Apr 22 '16 16:04 jiucheng-front

新人报道~

jiucheng-front avatar Apr 22 '16 16:04 jiucheng-front

测试

068089dy avatar Aug 15 '16 07:08 068089dy

nice! @nimojs 你可研究研究这个仓库commentit 看起来很拽的样子,可以直接在网站上面留言.... https://commentit.io/

jaywcjlove avatar Aug 21 '16 06:08 jaywcjlove

@jaywcjlove 感谢分享,commentit 不与issues关联数据保存在 .yml 文件中。

本项目会一直与 github issues 绑定,这样评论后 github 会推送消息给评论者的关注者。这样能更广泛的传播。

nimoc avatar Aug 21 '16 07:08 nimoc

github 不知有这样的借口没有,你应该把留言窗口也放到网站上。这样比较nice,同样达到了你想要的效果。

jaywcjlove avatar Aug 21 '16 07:08 jaywcjlove

@jaywcjlove 不错!如果不需要授权用类似 iframe 的方式评论就最好了。

nimoc avatar Aug 21 '16 07:08 nimoc

授权肯定是要的。 你要是吧这功能做了,这个仓库肯定能火 1000+star 😄 @nimojs

jaywcjlove avatar Aug 21 '16 07:08 jaywcjlove

@nimojs 哥哥啊,你应该把你的js 打个版本,不然我都不敢用,那天你js 变了,我的网站就坏了😄,或者找个cdn

比如我的JSLite 这里就有CDN https://cdnjs.com/libraries/jslite

jaywcjlove avatar Aug 21 '16 07:08 jaywcjlove

@jaywcjlove

感谢反馈

nimoc avatar Aug 21 '16 08:08 nimoc

awesome 谢谢

oozry12 avatar Aug 23 '16 02:08 oozry12

@jaywcjlove 已替换为 unpkg

nimoc avatar Aug 23 '16 09:08 nimoc

测试!

SuperAL avatar Mar 14 '17 07:03 SuperAL

test

tpwang avatar Jun 07 '17 12:06 tpwang

666

sirzxj avatar Aug 17 '17 09:08 sirzxj

沒明白怎麼使用到自己的rep

jiucheng-front avatar Aug 18 '17 02:08 jiucheng-front

@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>

nimoc avatar Aug 18 '17 03:08 nimoc

@nimojs 这原理是什么?跨域请求所有的数据?

jiucheng-front avatar Aug 18 '17 10:08 jiucheng-front

@wjf444128852 https://github.com/nimojs/github-comments/blob/gh-pages/lib/index.js 看源码 github有获取指定issue的http接口

nimoc avatar Aug 20 '17 14:08 nimoc

厉害!!!

shangfr avatar May 14 '18 15:05 shangfr

好像在GitPage里面没法实现 是不是Github做了什么限制 小白用户路过

DukeWF avatar Sep 10 '18 03:09 DukeWF

eeeeeeeeeeeeeee

QCMsofts avatar May 14 '19 05:05 QCMsofts

试一下~

Mr-Po avatar Jun 10 '19 01:06 Mr-Po