Make custom shields¶
Most of the shields used in our landing pages are generated on http://img.shields.io
Simply copying, pasting and editing the URL will generate new shields so for the most part, making new “simple” shields are easy. Just remember to do URL character substitution for spaces/special characters.
e.g. I want to make a “foo”, “bar far away” shield!
- Start with the “badge” URL https://img.shields.io/badge/
- Add “foo” https://img.shields.io/badge/foo
- Add “-” to separate the label from the message https://img.shields.io/badge/foo-
- Add “bar far away”, replacing spaces with “%20” https://img.shields.io/badge/foo-bar%20far%20away
- Add “-” to separate the message from the color https://img.shields.io/badge/foo-bar%20far%20away-
- Add the badge color (see https://img.shields.io) https://img.shields.io/badge/foo-bar%20far%20away-red
- Finish off with “.svg” at the end https://img.shields.io/badge/foo-bar%20far%20away-red.svg
Custom Icons¶
Although http://img.shields.io mentions:
?logo=data:image/png;base64,…
Insert custom logo image (≥ 14px high)—http://img.shields.io under Styles
It doesn’t actually tell you how to generate the … (base64 data).
We’ll use our Katana logo png at the root of our repository as an example.
Generate the base64 encoded version of the icon binary data
You can do this in Linux terminal by running
base64
with the file-w 0
to not wrap lines/wordsecho
to make things look nicer (places prompt in new line)
# While at the root of the repository base64 -w 0 icon_64.png; echo
This should output a massive line of URL friendly, encoded text.
There are also websites online that can generate
base64
encoded text for files/binary data (google it!).Create a badge URL, e.g. https://img.shields.io/badge/foo-bar%20far%20away-red.svg
See above example.
Add
?logo=data:image/png;base64,
and then the massive line of encoded text to it, resulting in something like:https://img.shields.io/badge/foo-bar%20far%20away-red.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH3AEbCjozhL61YwAAB7FJREFUeNrNW8tx2zoUPeF4uJUK4IyZCqxUIGbNhZkKrFRguQLTFYSuwFQFlhdcm6ogVAfUDAuQttzkLXThwFcAAYikXjCjSfQxiXtwcO4P/PLnzx+MPdoiiADMAIT0rxg3AGoAB3q/B1DRq/bjphp7bl/GA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