Adding badges to your README

Kent C. Dodds
InstructorKent C. Dodds
Share this video with your friends

Social Share Links

Send Tweet
Published 9 years ago
Updated 6 years ago

It's nice to know the status of a project. Adding badges to your readme gives first-timers and old-timers an at-a-glance peek into the status of your project. In this lesson, we'll add several badges using shields.io

[00:00] Now that we have a build and coverage reporting at our library as Published NPM, we'd like to add some badges to our Read Me, that people know the status of our project. Right now, our Read Me is looking pretty sad.

[00:14] This would be a good opportunity to actually document the API of our Read Me. we're going to just add badges to our Read Me so people can keep up with the status. There is a really cool site called "Shields.iom." Here it has badges for a lot of different services.

[00:33] We're going to get all of our badges from this service. First, we're going to get Travis for our build. I'll copy this. We'll get into our Read Me. We're going to put this in our mark down as an image. This is the syntax for an image. We'll have a couple of these.

[00:48] This is the description. Travis Build. This is the link to the image. This is for node. If we go to that URL, it will see the build is failing for node apparently, but if we change it to this, "Star Wars Names," then we see the build is parsing.

[01:08] Also, I actually prefer the flat style, flat squared. We'll say, "Style is flat square." That is what we'll use for our URL. Now we have the badge in our Read Me, but we want to actually have the badge be linked to our build. We're going to take this icon image and we'll make that a link in itself.

[01:38] Now, whatever we put into here will be the URL and we want to link to our build, which is right here. Well just put that in there. Now we have a badge for Travis. Let's go ahead and add one for Codecov and a couple for NPM, information about NPM, and link to those as well.

[01:59] There we have all the badges that we're going to include in this Read Me. There are a ton more that you can add from shields.iom. Many services will have their own badges as well. It's very simple. You simply add the image annotation there, with the name of the image, and a link to the image.

[02:19] Then you can turn that into a link by simply surrounding it by the brackets and then putting your link in here. That's adding badges to your Read Me.

egghead
egghead
~ 7 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today