Shields: Are you have any example of Dynamic badge?

Created on 13 Dec 2017  路  6Comments  路  Source: badges/shields

I have found that has dynamic badge, but I don't know how to use it.

question

Most helpful comment

I highly advice you to read the PR implementing this feature (https://github.com/badges/shields/pull/820), it helped me to understand it.

I really think there should be a explanation and link to that JSONpath expression evaluator!

All 6 comments

I would like to know it too.
I'm trying to add a version badge, and the version is inside a .json.

I highly advice you to read the PR implementing this feature (https://github.com/badges/shields/pull/820), it helped me to understand it.

I really think there should be a explanation and link to that JSONpath expression evaluator!

@tooomm

Just to understand how badges work.
When we call for example a build pipeline using travis: https://img.shields.io/travis/USER/REPO.svg.
If i put my user and repo, how does it know which badge show?

A dynamic badge, when i put $.version, generates a new .svg or update someone?

Sorry about being a beginner but i would really like to learn to make my readme files more descriptive.

If i put my user and repo, how does it know which badge show?

Because of the services name (travis) in the link: https://img.shields.io/travis/USER/REPO.svg. :)
Other badges look like this "https://img.shields.io/appveyor/ci/USER/REPO.svg".
The travis one is the only one with this user/repo declaration in the example list, all others use real data there... that might confuses you and should get changed, yes.

A dynamic badge, when i put $.version, generates a new .svg or update someone?

I don't know what you mean exactly. But a dynamic badge is a dedicated badge with its own .svg

@tooomm Now i understood, it takes repository metadata. I tried with a gitlab project with it private token and worked.

Thanks!

Let us know if you have more questions!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bruno-garcia picture bruno-garcia  路  3Comments

calebcartwright picture calebcartwright  路  3Comments

Fazendaaa picture Fazendaaa  路  3Comments

niccokunzmann picture niccokunzmann  路  3Comments

rominf picture rominf  路  3Comments