Skip to content

Badge

Mark a feature, version or table cell with a short status label such as Beta or deprecated, in one of five semantic tones.

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

Source
{{< badge text="Beta" tone="warning" >}}
Beta

text is the only required parameter, and it must not be empty.

Five tones

Source
{{< badge text="Default" >}}
{{< badge text="Info" tone="info" >}}
{{< badge text="Supported" tone="success" >}}
{{< badge text="Experimental" tone="warning" >}}
{{< badge text="Deprecated" tone="danger" >}}

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:

Source
Logical replication {{< badge text="off by default" tone="neutral" >}} needs
`wal_level = logical`. The `pg_duckdb` extension {{< badge text="opt-in" tone="info" >}}
is installed separately, and the backup repository {{< badge text="needs a server" tone="warning" >}}
must point at an object store before the first backup runs.

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:

Source
### OpenAPI pages {#openapi-example}

{{< badge text="new in 0.5" tone="success" >}} This section covers…

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”:

Source
| Component | Form | Status |
| --- | --- | --- |
| Callouts | `> [!NOTE]` | {{< badge text="stable" tone="success" >}} |
| Galleries | ` ```gallery ` fence | {{< badge text="stable" tone="success" >}} |
| PlantUML | ` ```plantuml ` fence | {{< badge text="opt-in" tone="info" >}} |
| The `image` shortcode | — | {{< badge text="removed" tone="danger" >}} |
Component Form Status
Callouts > [!NOTE] stable
Galleries ```gallery fence stable
PlantUML ```plantuml fence opt-in
The image shortcode — removed

In lists and steps

Source
1. Install Hugo {{< badge text="0.170+" tone="info" >}}
1. Create a site from OINK Starter and change `baseURL` in `hugo.yaml`
1. `hugo server` to preview {{< badge text="port 1313" tone="neutral" >}}
{.steps}
  1. Install Hugo 0.170+
  2. Create a site from OINK Starter and change baseURL in hugo.yaml
  3. hugo server to 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:

Source
{{< cards >}}
{{< card title="Hugo Module" icon="fa-brands fa-golang" badge="recommended" >}}
One `hugo mod get` and you are done {{< badge text="needs Go" tone="info" >}}
{{< /card >}}
{{< card title="Offline archive" icon="fa-solid fa-box-archive" >}}
Builds on a machine with no network {{< badge text="manual upgrades" tone="warning" >}}
{{< /card >}}
{{< /cards >}}
Hugo Modulerecommended

One hugo mod get and you are done needs Go

Offline archive

Builds on a machine with no network manual upgrades

link turns the badge into a link. It accepts a site path, a relative path, an http(s): URL or a mailto: address:

Source
Current version {{< badge text="v0.5" tone="info" link="/blog/" >}};
for the upgrade steps see {{< badge text="Upgrading" tone="neutral" link="/docs/admin/upgrade/" >}}.

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

text , plain text , default—
Required, non-empty. What the reader sees
tone , enum , defaultneutral
neutral info success warning danger

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.
  • Cards — card has a badge parameter of its own
  • File trees — tone uses the same vocabulary
  • Keys — the other inline shortcode
  • Callouts — when the status needs explaining