github的README上加入标签/图像链接/badges

文章目录

1. 炫酷的标签

1.1 常见标签

1. Open in Colab

在这里插入图片描述

 [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/bipinKrishnan/fastai_course/blob/master/bear_classifier.ipynb)     

其实语法很简单,就是将显示图像作为链接名称(图像就直接是colab的图标),后面再跟上对应的链接目标


2. Binder

在这里插入图片描述

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/bipinKrishnan/fastai_course/master)

结构同上。


3. 多个标签并列

这时候需要使用一点前端的小知识

github follow

Hang Zhang

Google Scholar

Email

LinkedIn

知乎

<p> 
  <a href="https://github.com/zhanghang1989?tab=followers"> <img src="/res/2022/10-14/23/0a9490ed02a9fd6de820e8228159a7f1.jpg" height="25px" alt="github follow" /> </a>
  <a href="https://hangzhang.org/"> <img src="https://img.shields.io/badge/&#8459-homepage-3875B7.svg?labelColor=21438A&style=plastic" height="25px" alt="Hang Zhang">
  <a href="https://scholar.google.com/citations?user=gCoWdkUAAAAJ"><img src="/res/2022/10-14/23/964f8225a1648451801105787a248908.svg" alt="Google Scholar" height="25px"> </a>
  <a href="mailto:[email protected]"> <img src="/res/2022/10-14/23/4dd90848ae635848af1fc9a2b91d271d.svg" height="25px" alt="Email">
  <a href="https://www.linkedin.com/in/zhanghang0704/"><img src="/res/2022/10-14/23/75cb9518b3666719a513f79a686c1f2f.svg" height="25px" alt="LinkedIn"> </a>
  <a href="https://www.zhihu.com/people/zhanghang0704"><img src="/res/2022/10-14/23/26202cdfa2604bc77dd313790fc30317.svg" height="25px" alt="知乎"></a>
  <a href="https://hangzhang.org/cvHangZhang/cvHangZhang.pdf"> <img src="/res/2022/10-14/23/ee638cd86e1edd5529d522ed9bb1c54f.jpg" height="25px"> </a>
</p> 

只要把链接改成自己对应的账号url链接就行,这里使用a标签,是为了让标签大小可调节。如果无所谓这个东西的话,其实还是直接使用markdown语法来实现(但是很诡异,如果使用markdown的语法,会显示 外链图片无法转存。。。那就还是使用这种html的标签写法好了)

4. awesome标签

html的方式,如下

<a href="https://github.com/sindresorhus/123"><img src="/res/2022/10-14/23/7dff5b470d5e1cbe5ee31dab1b08abed.jpg"></a>

markdown的方式,如下:

[![awesome](/res/2022/10-14/23/7dff5b470d5e1cbe5ee31dab1b08abed.jpg)](https://github.com/sindresorhus/awesome)

5. 开源协议标签

html的写法:

<a href="https://creativecommons.org/licenses/by/4.0/"><img src="/res/2022/09-02/04/6d278d7c37678d8285aff4e292c8c7f4.svg
"></a>

其实最关键的地方是,如何去寻找这些标签的图像位置。。

6. 文档版本

html的写法:

<a href="https://creativecommons.org/licenses/by/4.0/"><img src="/res/2022/10-14/23/d59baf0cbae1b63eb480c1624d769477.jpg
"></a>

7. python语言版本

html写法

<a href="https://github.com/allegroai/clearml"><img src="/res/2022/10-14/23/154e7e153a73456e479017957fcc6ac3.jpg
"></a>

1.2 标签图像来源

其实稍微观察一下,就知道上面这些公用标签,很多都来自于:https://camo.githubusercontent.com这个网址。可惜打不开,改变搜索方式,
得到关于Camo的信息,包括以下链接:

但是这似乎只是一种保证图像可以及时更新/同步的方式。

感谢:GitHub Action to clear cache on Images in README

在这里插入图片描述


终于找到这些链接的正确名称了,不是tags,也不是images,而是badges

在这里插入图片描述


进而搜索找到了正确的位置:

2. 所有标签

2.1 标签列表

参考这两个网页: 150+ Badges for GitHubgithub-badges/shields

其中,shields这个组织自主维护了github的badges图像服务,帮助人们快速找到/生成自己想要的badges图像。(所以可以看到下面的图像链接都是shields来源,而上面都是camo.githubusercontent来源)

只需要把图像链接改成对应的badges的url即可

<a><img src="/res/2022/10-14/23/b836a978192e211740784381628366c8.jpg
"></a>

上面代码显示为(没加链接,不会跳转,就是个图):


为了防止有些人喷我抄袭,这里只放几个示意的截图,想要看全部和直接复制url链接的,还是去源链接(不要喷我抄袭,我标明了参考来源,我就是转运!!!搬运工!!!)

对应的github项目地址为:https://github.com/Envoy-VC/Badges-for-GitHub

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐