Making a Shields.io NuGet badge

26 Dec 2016   -   1 min read

EDIT: shields.io now has a NuGet badge

What is Shields.io?

Shields.io is a metadata badge service serving fast and scalable informational images as badges for GitHub, Travis CI, Jenkins, WordPress and many more services

Examples:
GitHub Stars AppVeyor Build Status GitHub Issues

Problem

Shields provides a wide variety of badges but unfortunately does not have a NuGet download counts badge.

Here’s how it should look like:
NuGet badge

Solution

The following code uses jQuery and String Interpolation

The trick is to call the NuGet API using AJAX and send the data to Shields to create a badge.






Share this: