-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimagining the static badge URLs #2673
Comments
Also ref #815 |
I've done some very basic experiments for this and have some initial suggestions. It looks like we can piggy back off the work done on the endpoint badge. Much of these suggestions here are copied from the documentation of the endpoint page and the main page. It probably makes sense for the parameters of static badge to match what exists as closely as possible. The url might be Available query string parameters:
Some parameters that may need further discussion.
|
Hey there! Thanks for picking this up 😄 Putting Along those lines I’d suggest we make it just In terms of the colors, there’s been adequate discussion about syncing up the existing In terms of logos: yea, we do support custom SVG logos on all the badges. IMO it would be good to update the globally supported logo parameters to match the endpoint badge along the same lines, with Agreed that I’m sort of on the fence about whether I do like the idea of being able to stringify the endpoint object into a query string and have that work with the static badge URL. That could be useful for building a UI to test custom badge endpoints, among other things. |
Works for me 👍
Sounds good. Would it be appropriate to make that change as part of this ticket? |
We can discuss it in this issue though I think it’s better done in two PRs. We like small PRs because they are easier to review, faster to merge, and less likely to conflict with other work. |
I think I didn't understand the purpose of |
A question about the internal naming. Since there is so much that already uses "static" in the name, which refers to the current static badge, perhaps "query string" is more appropriate for the internal naming. For example, the service class might be called |
Note that if you stumble into this issue looking for correct way to escape / encode URL's for Shields.IO badges then as @RedSparr0w just pointed out in the Shields.IO Discord the following needs to be applied to the label and message values:
|
Also I can devote some time helping with grunt work on this - I'm not a super great Python dev (Swift is my bag 😀) but happy to help where I can, I have a use case for nice url's cc @mbarkhau @paulmelnikow |
It's a nice thought. In documentation I don't think we should give it a new name because it's just another way of accessing the same functionality. Internally if we need to distinguish it from the existing @tomj Happy to have your help! It sounds like @mbarkhau is working on the query-param version. Do you want to think a bit about a new format for the URL version? I've been thinking a bit more about this and there may not be a URL form that can be parsed with path-to-regexp that doesn't require escaping for special characters. Though perhaps it's not necessary to provide a way to escape the slashed version if we have the legacy one with dashes and the query param version. |
no worries! I'll add some basic questions to my todo list so we're all on the same page here and have some base requirements hammered out :) |
This makes it possible to override the parameters `color` and `labelColor`. ref #2673
Query string static service is live! Thanks so much for your work @mbarkhau! |
As we discussed I'll leave this issue open to tackle this:
|
The static badge URL is well established, yet quirky. It uses a nonstandard escaping practice which only exists in Shields. It's inconvenient to generate programmatically for just that reason.
@RedSparr0w made an effort a while back to create a new one using the query string: #1395. I think it's a nice idea to do that and that we should do that using the schema for the endpoint badge, once that goes live #2495. That will support well the cases where badge URLs need to be generated in code.
Someone on Discord today was asking about a url like https://img.shields.io/badge/PyCalVer-v201901.0019--beta-blue.svg where the version sometimes has a suffix and sometimes doesn't, and thus sometimes but not always requires escaping. I'm checking if that is a programmatic case or a manual case.
We could also consider adding a version that uses the more traditional
/
separator, e.g./badge/:label?/:message/:color?
My only concern is about how to include slashes in the label and message. I'm not sure how to solve that. Maybe that case could fall back to either the query-string version or the legacy version.Obviously we'll need to support the legacy version as well.
The text was updated successfully, but these errors were encountered: