<span>添加GitHub的star/fork/watch按钮</span>


要实现上面的效果,首先必须了解一些参数👇

所需参数

您必须为以下每个 URL 参数声明一个值:

选项 描述
user 拥有仓库的 GitHub 用户名
repo GitHub 仓库名称
type 要显示的按钮类型: starwatchforksponsorfollow

可选参数

不需要以下 URL参数。根据需要添加它们。

选项 描述
count 显示可选的观察器或分叉计数:默认情况下没有或true
size 用于使用较大按钮的可选标志:默认情况下没有或large

Star

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=star&count=true&size=large" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=star&count=true" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>

Watch

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=watch&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=watch&count=true&v=2" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>

Fork

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=fork&count=true&size=large" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=fork&count=true" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>

可用选项

SSL 支持

示例按钮与 URL 一起显示。当 SSL 选项托管在 GitHub 页面上时,SSL 选项通过CloudFlare 的免费通用 SSL 产品提供。如果您愿意,您仍然可以使用 。https:// http://


更多

详见文档:https://ghbtns.com/

全部评论

相关推荐

不愿透露姓名的神秘牛友
06-18 16:32
quench@0916:一顿操作猛如虎,一看工资2500
点赞 评论 收藏
分享
每晚夜里独自颤抖:这个在牛客不是老熟人了吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务