When the user use a known end-point that has an icon (github, npm, travis ...), the API could automatically use the correct icon when requested. For example:
https://badgen.net/github/stars/micromatch/micromatch =>
https://badgen.net/github/stars/micromatch/micromatch?icon =>
I'm not sure what should happened when user request a specific icon, but I see no reasonable use-case for:
https://badgen.net/github/stars/micromatch/micromatch?icon=twitter =>
IMO, it's possible to ignore the icon parameter when a predefine one exists:
https://badgen.net/github/stars/micromatch/micromatch?icon=twitter =>
Yup, make sense totally. Because really it seems redundant when you are requesting the /github endpoint to add icon=github, it should be obvious and enough the just define empty icon query.
There's more use case for icon than just subject. For example, people may use windows icon on travis badge, and apple icon on circieci badge, to present build status for multiple platform.
It still will be possible to define an icon, but it should be possible to define empty icon param.
Defaults to travis one
badgen.net/travis/babel/babel?icon
but can still define another icons
badgen.net/travis/babel/babel?icon=windows
Oh, one more idea. What about allow defining more than one icon? :D
badgen.net/travis/babel/babel?icon=windows,linux,macos
馃槀 I would rather make a 3in1 icon called windows-linux-macos
naah ;d
This feature is live now.
Most helpful comment
There's more use case for icon than just subject. For example, people may use
windowsicon on travis badge, andappleicon on circieci badge, to present build status for multiple platform.