Skip to content
Snippets Groups Projects
Select Git revision
  • cc9a6db853bee19e2b7f0d26cab1fd451bdc07c4
  • master default protected
  • gh-pages
  • dependabot/npm_and_yarn/nock-14.0.6
  • dependabot/npm_and_yarn/react-19.1.0
  • dependabot/npm_and_yarn/react-dom-19.1.0
  • server-2025-02-01-6100669a
  • server-2024-11-01-87cba042
  • server-2024-10-01-6875b7c8
  • dependabot/npm_and_yarn/path-to-regexp-8.2.0
  • server-2024-09-01-3d52575c
  • daily-tests-gha2
  • daily-tests-gha
  • server-2023-12-01-92d8fb8e
  • server-2023-11-01-a80c93fd
  • server-2023-10-01-31096085
  • coc-v2
  • server-2023-09-01-8edc3810
  • server-2023-08-01-75858a03
  • server-2023-07-01-02183d8d
  • test-9317
  • server-2025-07-01
  • 5.0.2
  • 5.0.1
  • 5.0.0
  • server-2025-06-01
  • server-2025-05-01
  • server-2025-04-03
  • server-2025-03-02
  • server-2025-03-01
  • server-2025-02-02
  • server-2025-01-01
  • server-2024-12-01
  • server-2024-11-02
  • 4.1.0
  • server-2024-09-25
  • server-2024-09-02
  • server-2024-08-01
  • server-2024-07-01
  • 4.0.0
  • server-2024-06-01
41 results

shields

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Paul Melnikow authored and GitHub committed
    Ref: #1379
    
    This takes a naive approach to font-width computation, the most compute-intensive part of rendering badges.
    
    1. Add the widths of the individual characters.
        - These widths are measured on startup using PDFKit.
    2. For each character pair, add a kerning adjustment
        - The difference between the width of each character pair, and the sum of the characters' separate widths.
        - These are computed for each character pair on startup using PDFKit.
    3. For a string with characters outside the printable ASCII character set, fall back to PDFKit.
    
    This branch averaged 0.041 ms in `makeBadge`, compared to 0.144 ms on master, a speedup of 73%. That was on a test of 10,000 consecutive requests (using the `benchmark-performance.sh` script, now checked in).
    
    The speedup applies to badges containing exclusively printable ASCII characters. It wouldn't be as dramatic on non-ASCII text. Though, we could add some frequently used non-ASCII characters to the cached set.
    cc9a6db8
    History

    build status last deployed chat on Discord follow on Twitter

    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 470 million images.

    In addition to hosting the shields.io frontend and server code, this monorepo hosts an NPM library for generating badges, and the badge design specification.

    Examples

    • build status: build | failing
    • code coverage percentage: coverage | 80%
    • stable release version: version | 1.2.3
    • package manager release: gem | 1.2.3
    • status of third-party dependencies: dependencies | out-of-date
    • static code analysis GPA: code climate | 3.8
    • SemVer version observance: semver | 2.0.0
    • amount of Gratipay donations per week: tips | $2/week

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

    Browse a complete list of badges.

    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:

    GitHub issues by-label

    Or you can adopt one of these pull requests:

    GitHub pull requests by-label

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

    Using the badge library

    npm install -g gh-badges
    badge build passed :green .png > mybadge.png
    const badge = require('gh-badges')
    
    // Optional step, to have accurate text width computation.
    const format = {
      text: ['build', 'passed'],
      colorscheme: 'green',
      template: 'flat',
    }
    
    badge.loadFont('/path/to/Verdana.ttf', err => {
      badge(format, (svg, err) => {
        // svg is a string containing your badge
      })})

    View the documentation for gh-badges.

    Note: The badge library was last released in 2016.

    npm version

    Development

    1. Install Node 8 or later. You can use the package manager of your choice. Node 8 is required for building or developing the front end. Node 6 or 8 will work to run the server, and we'll transition to Node 8 everywhere once the production server is upgraded. Server tests need to pass in both.
    2. Clone this repository.
    3. Run npm install to install the dependencies.
    4. Run npm run build to build the frontend.
    5. Run npm start to start the server.
    6. Open http://[::]:8080/ to view the home page.

    To generate the frontend using production cache settings – that is, badge preview URIs with maxAge – run LONG_CACHE=true npm run build.

    To analyze the frontend bundle, run npm install webpack-bundle-analyzer and then ANALYZE=true npm start.

    Hosting your own server

    There is documentation about hosting your own server.

    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

    espadrine is the sysadmin.

    These contributors donate time on a consistent basis to help guide and maintain the project:

    Related projects

    License

    All assets and code are under the CC0 LICENSE and in the public domain unless specified otherwise.

    The assets in logo/ are trademarks of their respective companies and are under their terms and license.

    Contributors

    This project exists thanks to all the people who contribute. [Contribute].

    Backers

    Thank you to all our backers! 🙏 [Become a backer]

    Sponsors

    Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]