shields动态生成Git项目徽章

0

项目地址:https://shields.io/

之前都是用的shields提供的一些build、version这些,但是码云就用不了。
本来今天想要重新做一个的,但是发现原来还可以动态生成。

格式:

https://img.shields.io/badge/dynamic/json?url=<URL>&label=<LABEL>&query=<$.DATA.SUBDATA>&color=<COLOR>&prefix=<PREFIX>&suffix=<SUFFIX>
https://img.shields.io/badge/dynamic/xml?url=<URL>&label=<LABEL>&query=<//data/subdata>&color=<COLOR>&prefix=<PREFIX>&suffix=<SUFFIX>
https://img.shields.io/badge/dynamic/yaml?url=<URL>&label=<LABEL>&query=<$.DATA.SUBDATA>&color=<COLOR>&prefix=<PREFIX>&suffix=<SUFFIX>

比如码云stars:

https://img.shields.io/badge/dynamic/json?style=flat-square&label=Gitee%20stars&url=https://gitee.com/api/v5/repos/acgist/snail&query=$.stargazers_count

码云stars

代码有命名空间的XML的XPATH:

https://img.shields.io/badge/dynamic/xml?style=flat-square&label=JavaFX&url=https://raw.githubusercontent.com/acgist/snail/master/pom.xml&query=//*[local-name()='javafx.version']