Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown Reference Link with shields.io badges

How to make sure that the shields.io badge points to the site, and do that using reference-style markdown links.

This works fine

[![](https://img.shields.io/badge/code%20style-black-black.svg?style=for-the-badge&labelColor=gray)][http://github.com/psf/black]

[][http://github.com/psf/black]

This doesn't works

![]([black-shield])[black]

[black]: http://github.com/psf/black
[black-shield]: https://img.shields.io/badge/code%20style-black-black.svg?style=for-the-badge&labelColor=gray
like image 433
dracarys3 Avatar asked Oct 22 '25 11:10

dracarys3


2 Answers

The correct syntax is

[![General badge](https://img.shields.io/badge/<SUBJECT>-<STATUS>-<COLOR>.svg)](https://shields.io/)

Example

[![Stack Overflow Badge](https://img.shields.io/badge/Stack%20Overflow-F58025?logo=stackoverflow&logoColor=fff&style=flat)](https://stackoverflow.com/users/12299287/cryptocode)

Produces Stack Overflow Badge

like image 89
CryptoCode Avatar answered Oct 25 '25 08:10

CryptoCode


Works using square brackets!

[![][black-shield]][black]

[black]: http://github.com/psf/black
[black-shield]: https://img.shields.io/badge/code%20style-black-black.svg?style=for-the-badge&labelColor=gray
like image 28
dracarys3 Avatar answered Oct 25 '25 08:10

dracarys3



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!