首页 > 其他 > 详细

添加GitHub的star/fork/watch按钮

时间:2020-07-16 13:01:15      阅读:50      评论:0      收藏:0      [点我收藏+]

技术分享图片
要实现上面的效果,首先必须了解一些参数??

所需参数

您必须为以下每个 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/

添加GitHub的star/fork/watch按钮

原文:https://www.cnblogs.com/melodyjerry/p/13321692.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!