Shields: Left and right label values as params?

Created on 23 Oct 2016  Â·  5Comments  Â·  Source: badges/shields

?leftLabel=foo&rightLabel=bar <= Is this a thing? I swear I looked through the issues and couldn't find it.

If you try to double it up like the link param, it just concats a comma and the 2nd value to the left label.

service-badge

Most helpful comment

It's a good idea. I like the dashes as shorthand for simple badges, though they are not useful for complex things nor programmatic generation. We should keep the current URL scheme working, for backward compatibility, though how about we add a second one https://img.shields.io/badge.svg?… which pulls everything from the query string?

All 5 comments

To be clear, yes, I'm asking about the params. I realize you can just specify the right side with a dash.

pretty sure the only param is ?label=foo to change the left label and the only way to specify left & right label is https://img.shields.io/badge/<leftlabel>-<rightlabel>-<color>.svg

This is rather frustrating when attempting to create a custom badge URL because it means the right-side can't be provided without some escaping.

I'm trying to generate custom badges where the right side is a semver version string, which can contain dashes. In order to account for the "normal" use of the dash as the

It would be preferable if all portions could be specified via query params, such that the status portion could be provided without needing to escape it (well, other than the URI escaping which is necessary regardless where in the URL that segment lives).

It's a good idea. I like the dashes as shorthand for simple badges, though they are not useful for complex things nor programmatic generation. We should keep the current URL scheme working, for backward compatibility, though how about we add a second one https://img.shields.io/badge.svg?… which pulls everything from the query string?

Let's track this in #2673.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

salaros picture salaros  Â·  3Comments

paulmelnikow picture paulmelnikow  Â·  3Comments

korenyoni picture korenyoni  Â·  3Comments

Fazendaaa picture Fazendaaa  Â·  3Comments

bruno-garcia picture bruno-garcia  Â·  3Comments