Carter Cole LinkedInCarters Twitter PageCarter Cole on Facebook Carter Coles RSS

Monday, December 12, 2011

Github badges the easy way

I have a big problem with scope creep... its one of the things ive been trying to work on as a developer but its just funny to me that I would have scope creep on a blog post. This entire post came out as scope creep of my previos post because I wanted an easy way to add one of the Github ribbons that say "fork this repo". My problem came when i tried to use the code from this page on github blog but it didnt work unless it was injected into the body... so i decided to write a simple script to inject the badge with javascript so all you have to do is include a little script tag with your username, the repo and what color and it would automatically drop it on the page

These are the options you can pass in the querystring to change how it will be rendered &usr= This is your github username
&repo= This is the repo to link to
&side= What side ['left' or 'right']
&color= The color of the ribbon ['red','orange','dblue','lgrey','green','white']

If you want to implement something thats not cross browser then you should check this out. I really like what this guy did with his css3 version that has a special message when you mouseover

And just so you can see what gets onto the pages... you can choose left or right the colors are the same

1 remarks:

Post a Comment

Link to this post if you found it usefull

Github badges the easy way