-
Notifications
You must be signed in to change notification settings - Fork 0
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
RulatedayDnd5eWiki #1
Comments
GitalkGitalk 是一个基于 GitHub Issue 和 Preact 开发的评论插件。 特性
安装两种方式
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<!-- or -->
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
npm i --save gitalk import 'gitalk/dist/gitalk.css'
import Gitalk from 'gitalk' 使用首先,您需要选择一个公共github存储库(已存在或创建一个新的github存储库)用于存储评论, 然后需要创建 GitHub Application,如果没有 点击这里申请, 最后, 您可以选择如下的其中一种方式应用到页面: 方式1添加一个容器: <div id="gitalk-container"></div> 用下面的 Javascript 代码来生成 gitalk 插件: var gitalk = new Gitalk({
clientID: 'GitHub Application Client ID',
clientSecret: 'GitHub Application Client Secret',
repo: 'GitHub repo',
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') 方式2:在React使用使用以下代码引入Gitalk组件 import GitalkComponent from "gitalk/dist/gitalk-component"; 按以下方式在React中使用Gitalk组件 <GitalkComponent options={{
clientID: "...",
// ...
// 设置项
}} /> 设置
实例方法
TypeScript已经包括了配置项和Gitalk类的类型定义,不包括React组件的类型定义。 贡献
类似项目许可MIT |
http://127.0.0.1/0.html?
The text was updated successfully, but these errors were encountered: