Closed czy-29 closed 2 months ago
Do you mean being able to replace the text presented in the dependency status badge?
Do you mean being able to replace the text presented in the dependency status badge?
Yep!
I want to show two dependency status badges at the same time: a specific crate version, and the github repository version. If both badges show the word dependencies
on the left, it will cause some confusion, so I want to customize the text on the left, which is what I call the label
.
@Enet4 I read the code, and it seems that it is relatively simple to add this feature.
To customize the subject text on the left through URL query parameters, we only need to add a subject: Option<String>
field to the server::ExtraConfig
structure, and then modify the implementation of the server::views::badge::badge
function.
Then when the subject
parameter exists in the URL, we ignore the compact
parameter and use the text specified by subject
. But when subject
does not exist, we still use the logic of compact
to achieve API compatibility.
Finally, we update the document in README and add the description of the new subject
parameter, and everything is done.
If such a change meets your expectations, I think I can implement it and submit a PR, which does not seem difficult.
I have submitted the PR: #231 Welcome to review!
Support custom labels (to replace the hard-coded
dependencies
label)