Badgen.net: [Feature request] Automatic icon

Created on 3 Sep 2018  路  6Comments  路  Source: badgen/badgen.net

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 =>

Most helpful comment

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.

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shellscape picture shellscape  路  4Comments

wopian picture wopian  路  3Comments

papb picture papb  路  3Comments

sindresorhus picture sindresorhus  路  6Comments

amio picture amio  路  5Comments