shields README

The project's README from github.com/badges/shields. As one markdown file: README.md.

Daily Tests Status Code Coverage Chat on Discord

This is home to Shields.io, a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services. Every month it serves over 1.6 billion images and is used by some of the world's most popular open-source projects, VS Code, Vue.js and Bootstrap to name a few.

This repo hosts:

Examples

Make your own badges! (Quick example: https://img.shields.io/badge/left-right-f39f37)

Quickstart

Browse a complete list of badges and locate a particular badge by using the search bar or by browsing the categories. Click on the badge to fill in required data elements for that badge type (like your username or repo) and optionally customize (label, colors etc.). And it's ready for use!

Use the button at the bottom to copy your badge url or snippet, which can then be added to places like your GitHub readme files or other web pages.

Contributing

Shields is a community project. We invite your participation through issues and pull requests! You can peruse the contributing guidelines.

When adding or changing a service please add tests.

This project has quite a backlog of suggestions! If you're new to the project, maybe you'd like to open a pull request to address one of them.

You can read a tutorial on how to add a badge.

GitHub issues by-label

If you intend on reporting or contributing a fix related to security vulnerabilities, please first refer to our security policy.

Development

Open in GitHub Codespaces

  1. Install Node 24. You can use the package manager of your choice.
  2. Clone this repository.
  3. Run npm ci to install the dependencies.
  4. Run npm start to start the badge server and the frontend dev server.
  5. Open http://localhost:3000/ to view the frontend.

When server source files change, the badge server should automatically restart itself (using nodemon). When the frontend files change, the frontend dev server (docusaurus start) should also automatically reload. However the badge definitions are built only before the server first starts. To regenerate those, either run npm run prestart or manually restart the server.

To debug a badge from the command line, run npm run badge -- /npm/v/nock. It also works with full URLs like npm run badge -- https://img.shields.io/npm/v/nock.

Use npm run debug:server to start server in debug mode. This recipe shows how to debug Node.js application in VS Code.

Snapshot tests ensure we don't inadvertently make changes that affect the SVG or JSON output. When deliberately changing the output, run SNAPSHOT_DRY=1 npm run test:package to preview changes to the saved snapshots, and SNAPSHOT_UPDATE=1 npm run test:package to update them.

The server can be configured to use Sentry (configuration) and Prometheus (configuration).

Our full test suite as well as code coverage are run on a daily basis.

Hosting your own server

There is documentation about hosting your own server.

Awesome

Status badges are used widely across open-source and private software projects. Academics have studied the "signal" badges provide about software project quality. There are many existing libraries for rendering these badges, and alternatives to the hosted Shields badge service. awesome-badges is a curated collection of such resources. Contributions may be considered there. (The presence of a project in that collection should not be interpreted as an endorsement nor promotion from the Shields project)

History

b.adge.me was the original website for this service. Heroku back then had a thing which made it hard to use a toplevel domain with it, hence the odd domain. It used code developed in 2013 from a library called gh-badges, both developed by Thaddée Tyl. The project merged with shields.io by making it use the b.adge.me code and closed b.adge.me.

The original badge specification was developed in 2013 by Olivier Lacan. It was inspired by the Travis CI and similar badges (there were a lot fewer, back then). In 2014 Thaddée Tyl redesigned it with help from a Travis CI employee and convinced everyone to switch to it. The old design is what today is called the plastic style; the new one is the flat style.

You can read more about the project's inception, the motivation of the SVG badge specification, and the specification itself.

Project leaders

Maintainers:

Alumni:

License

Shields.io is dual licensed and distributed under the terms of both the MIT license and the Apache license (Version 2.0).

Community

Thanks to the people and companies who donate money, services or time to keep the project running. https://shields.io/community

shields (badges/shields)

Searching Database…

27.3K ·GitHub
这是干什么的?Shields.io —— 一个提供简洁、统一、易读徽章的服务,支持 SVG 和位图格式,专门用来嵌入 GitHub README 或其他任何网页。
它是一个托管的网站、一个 npm 库,还是我可以自己跑的东西?三者都是:shields.io 上有托管服务,这个仓库里有服务端和前端代码,还有一个叫 badge-maker 的 npm 库,可以在代码里生成徽章。你也可以自己部署这个服务端。
我怎么把徽章放到自己的项目上?在 shields.io 上浏览或搜索徽章列表,点击你需要的那个,填入用户名或仓库之类的数据,想调整文字和颜色也可以改,然后把 URL 或代码片段复制到你的 README 里。
如果我想改代码,需要准备什么?Node 24(engines 也允许 26):克隆仓库,运行 npm ci,然后运行 npm start 启动徽章服务器和前端开发服务器;改动代码时 nodemon 会自动重启服务器。
跑开发服务器有什么要注意的坑?徽章定义只在服务器第一次启动前构建,所以改了定义之后必须运行 npm run prestart 或者重启服务器。服务端和前端都支持热重载,但徽章定义不会。
我可以不依赖 shields.io,自己搭一个徽章服务器吗?可以 —— 仓库里有自己搭建服务器的文档,CI 里也配置了 Docker 镜像构建。自托管的服务器还可以选择上报到 Sentry 和 Prometheus。
徽章到底能显示哪些内容?支持几十种数据来源:持续集成服务、软件包仓库、应用商店、社交网络、代码覆盖率和代码分析工具等。比如覆盖率百分比、发布版本、依赖状态、Liberapay 每周捐款数、Python 包下载量、Chrome 扩展评分和在线率。
它用的人多吗?它每月提供超过 16 亿张徽章图片,全球一些最流行的开源项目都在用,包括 VS Code、Vue.js 和 Bootstrap。
badge-maker 这个 npm 包是做什么用的?它是托管在这个仓库里的一个 npm 库,让你能在自己的代码里以编程方式生成同样风格的徽章,并且自带文档和更新日志。
Shields 是怎么来的?它始于 2013 年,最初是一个叫 gh-badges 的库和一个名字古怪的网站 b.adge.me,作者都是 Thaddee Tyl。Olivier Lacan 制定的原始徽章规范受 Travis CI 徽章的启发;两者后来合并成了 shields.io,旧设计则以 plastic 风格的形式保留了下来。
Creator
badges
Size
517.6 MB
Stars
27.3K
Updated
CommitOct 12
Age
13y
Commits · 90 Days