Badges
Render img.shields.io badges with curated directive resolvers and strict Shields escape hatches.
Badges
Use ::badge leaf directives for individual Shields images and :::badges to group them.
1:::badges2::badge[npm]{3 type="npm"4 target="version"5 package="@valkyrianlabs/payload-markdown"6 href="https://www.npmjs.com/package/@valkyrianlabs/payload-markdown"7}8:::
::badge renders an img from https://img.shields.io. When href is present, the renderer wraps the image in an anchor. Click behavior uses that anchor wrapper; the directive does not use Shields' link query parameter.
::badge
Common attributes:
[Label]: default imagealttextalt: overrides the label-derived image alt texthref: optional link targetnewTab: addstarget="_blank"andrel="noopener noreferrer"whentruestyle,logo,logoColor,logoSize,label,labelColor,color, andcacheSeconds: passed through to Shields as encoded query attributes
Curated resolvers:
type="static"withlabel,message, andcolortype="npm"withtarget="version",target="downloads", ortarget="license"andpackagetype="npm" target="downloads"also acceptsinterval; default isdwtype="github" target="workflow"withrepoandworkflowtype="github"withtarget="release",target="license", ortarget="stars"andrepotype="debian" target="version"withpackagetype="apt"is an alias fortype="debian"
1::badge[build]{2 type="github"3 target="workflow"4 repo="valkyrianlabs/payload-markdown"5 workflow="deploy.yml"6 href="https://github.com/valkyrianlabs/payload-markdown/actions"7}
1::badge[downloads]{2 type="npm"3 target="downloads"4 package="@valkyrianlabs/payload-markdown"5 interval="dm"6}
1::badge[debian]{2 type="debian"3 target="version"4 package="curl"5}
1::badge[static]{2 type="static"3 label="docs"4 message="ready"5 color="0ea5e9"6}
Escape Hatches
Use path for a Shields path that is not covered by the curated resolver map:
1::badge[coverage]{2 path="badge/coverage-95%25-brightgreen"3 style="flat-square"4}
Use src only for full Shields URLs. The renderer rejects non-https://img.shields.io hosts.
1::badge[custom]{2 src="https://img.shields.io/badge/custom-badge-blue"3}
:::badges
Attributes:
align:left,center, orrightgap:sm,md, orlgwrap:trueorfalse
Defaults:
align="left"gap="md"wrap="true"
1:::badges{2 align="center"3 gap="md"4 wrap=true5}6::badge[npm]{7 type="npm"8 target="version"9 package="@valkyrianlabs/payload-markdown"10}11::badge[license]{12 type="npm"13 target="license"14 package="@valkyrianlabs/payload-markdown"15}16:::