Skip to content

nimojs/github-comments

 
 

Repository files navigation

Github 留言系统

github 留言系统推荐使用功能更强大的 https://utteranc.es/

在线预览

让评论质量更高,让网站与 Github 关联 适合程序员的评论系统,基于 Github issues 留言

preview

使用

data-api

<style>.gc-comments {font:12px/1.5 Lantinghei SC,Microsoft Yahei,Hiragino Sans GB,Microsoft Sans Serif,WenQuanYi Micro Hei,sans-serif}</style>
<script src="https://unpkg.com/github-comments/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 target="_blank" href="issues_link">issues_link</a> 提交评论
    </div>
</div>

issues_link 会自动替换成 https://github.com/nimojs/github-comments/issues/1

gc.load()

gc.load(repos, issues, element, noCommentsTip)
// 或者
githubComments.load(repos, issues, element, noCommentsTip)
// 当 全局变量 gc 被占用时使用 githubComments
参数 说明 示例
repos 项目地址 nimojs/blog
issues issues id 2
element 渲染容器 "#demo" document.getElementById('demo') $('#demo')
<div id="demo"></div>
<script src="https://unpkg.com/github-comments@0.4.0/gc.js"></script>
<script>
gc.load('nimojs/blog', 2, '#demo')
</script>

灵感来自: http://fex.baidu.com/webuploader/demo.html

参与开发

git clone https://github.com/nimojs/github-comments.git
cd github-comments
npm i --registry=https://registry.npm.taobao.org
# server
npm run s
npm run dev

Releases

No releases published

Packages

No packages published

Languages

  • CSS 55.1%
  • JavaScript 26.6%
  • HTML 18.3%