Badge
A badge is a small inline label that sits after a name and states its status in a word or two: Beta, deprecated, v0.5, needs a server. You choose what the status means, one of five tones, and the theme picks colors that keep their contrast in light and dark mode. When the status needs a reason, a procedure or a deadline, write a sentence or a callout instead.
Shortest form
text is the only required parameter, and it must not be empty.
Five tones
Default Info Supported Experimental Deprecated
Without tone a badge is neutral. Any value other than these five warns
and falls back to neutral, and there is no way to set a custom color.
Inside a sentence
A badge follows the name it describes, on the same line:
Logical replication off by default needs
wal_level = logical. The pg_duckdb extension opt-in
is installed separately, and the backup repository needs a server
must point at an object store before the first backup runs.
Next to a heading
Do not put a badge, or any other shortcode, in a heading. Hugo builds the table of contents before it expands shortcodes, so the heading looks right but its table-of-contents entry shows an internal Hugo placeholder. Put the badge at the start of the first paragraph instead:
OpenAPI pages
new in 0.5 The badge sits right under the heading, the table of contents stays clean, and a shared link to the heading does not carry the badge text.
In table cells
In a comparison table, a column of badges is quicker to scan than a column of “yes” and “no”:
| Component | Form | Status |
|---|---|---|
| Callouts | > [!NOTE] |
stable |
| Galleries | ```gallery fence |
stable |
| PlantUML | ```plantuml fence |
opt-in |
The image shortcode |
— | removed |
In lists and steps
- Install Hugo 0.170+
- Create a site from OINK Starter and change
baseURLinhugo.yaml hugo serverto preview port 1313
On cards
A card has a badge parameter of its own, plain text shown beside the title,
and its body can hold badge shortcodes as well:
One hugo mod get and you are done needs Go
Builds on a machine with no network manual upgrades
Clickable badges
link turns the badge into a link. It accepts a site path, a relative path,
an http(s): URL or a mailto: address:
Current version v0.5; for the upgrade steps see Upgrading.
An invalid link warns and is dropped, leaving a plain badge.
Output
Badges load no script, and print and RSS show them as they appear on the
page. A badge exists only as a shortcode, with no native Markdown form, so the
page’s Markdown output turns it into bold text: **Beta**, or [**Beta**](/…)
when it has a link.
Parameter reference
Badges take named parameters only; there is no icon, class, color,
outline or size. Mistakes warn and fall back: an unknown parameter is
ignored, a missing or empty text renders nothing, an unknown tone becomes
neutral, and an unsafe link is dropped.
Limits
- The color only reinforces the text, so the text must state the status on
its own.
{{< badge text="🔴" >}}tells a screen reader nothing. - There is no icon parameter. For an icon, use cards or a callout.
- Keep the text to a few words. A badge does not wrap, so longer text belongs in the sentence.
- Use at most three badges in one place; a row of them buries the name they describe.
Related
- Cards —
cardhas abadgeparameter of its own - File trees —
toneuses the same vocabulary - Keys — the other inline shortcode
- Callouts — when the status needs explaining