htmlgithubmarkdownshields.io

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

Solution

  • 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