Shortcodes

Callouts

Six callout types via the relearn-compatible `notice` shortcode.

6 min

Callouts are the most-used shortcode in any workshop. The theme ships one shortcode — notice — with six built-in styles, each with its own color and icon. It’s a drop-in for hugo-theme-relearn’s notice , so existing relearn content migrates verbatim.

The six styles

Tip

A warm, helpful aside. Use for shortcuts, mnemonics, and “you’ll thank me later” details.

Note

A neutral aside. Useful when you want to set something off without raising an alarm.

Info

Reference material — versions, defaults, “by the way” details.

Warning

Heads-up. Something a careful reader needs to know before continuing.

Danger

Hard-stop. Skipping this will break your build, lose data, or page someone at 3am.

Success

Confirmation. Use after a checkpoint or successful exercise.
markdown
{{< notice tip >}}
A warm, helpful aside.
{{< /notice >}}

With a custom title

Pro move

Pass the title as the second positional argument, or title="…". Falls back to the style name when omitted.
markdown
{{< notice tip "Pro move" >}}
Use the keyboard shortcut to skip the menu altogether.
{{< /notice >}}

Parameters

All parameters are optional. Positional 0/1/2 map to style/title/icon.

ParamNotes
styleSemantic preset OR relearn colour alias. See table below.
titleHeader label. Falls back to the i18n-resolved type name.
iconOverride the default icon (any Lucide name we ship).
colorCustom accent colour for the border + icon. Any CSS colour.
expanded"true" (open, can collapse) / "false" (closed, can expand). Renders the notice as a <details> widget. Unset means a plain styled block.
groupidSynced-collapse group name — multiple <details> notices with the same id behave like radio buttons (uses the native <details name> attribute).

Style presets

style=maps to
note (default)note
info primary importantinfo
tiptip
warning caution orange yellowwarning
danger error reddanger
success greensuccess
blueinfo
gray grey secondary code defaultnote

Style values are case-insensitive — style="Info" and style="info" resolve the same way. See Migrating from relearn for the full migration checklist.

Custom icon

Override the default icon with any Lucide name the theme ships (rocket, shield, download, etc.).

Lift off

The icon param accepts any name from the Icons catalog.
markdown
{{% notice style="tip" title="Lift off" icon="rocket" %}}
The `icon` param accepts any name from the [Icons](../07-icons/) catalog.
{{% /notice %}}

Collapsible

Set expanded="true" for an open-by-default <details> the reader can collapse, or expanded="false" for the opposite.

Advanced details
Useful for “extra reading” or platform-specific tangents you don’t want to dominate the page. The collapsed state is native browser behaviour — no JS.
markdown
{{% notice style="info" title="Advanced details" expanded="false" %}}
Collapsed by default; reader can expand to see the body.
{{% /notice %}}

Use groupid to sync multiple <details> notices so opening one closes the others (native <details name> attribute, no JS).

GitHub Alerts — markdown syntax

If you’re authoring in plain markdown (or migrating content from a GitHub README), the theme also recognises GitHub Alerts . They route through the same renderer as notice, so the output is identical to a shortcode invocation.

markdown
> [!NOTE]
> Useful information that users should know.

> [!TIP]
> Helpful advice for doing things better.

> [!IMPORTANT]
> Key information users need to know to achieve their goal.

> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.

> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.

Renders as:

Note

Useful information that users should know.

Tip

Helpful advice for doing things better.

Info

Key information users need to know to achieve their goal.

Warning

Urgent info that needs immediate user attention to avoid problems.

Danger

Advises about risks or negative outcomes of certain actions.

GitHub’s five types map onto the theme’s six like this:

GitHub AlertTheme callout
[!NOTE]note
[!TIP]tip
[!IMPORTANT]info (sky blue)
[!WARNING]warning
[!CAUTION]danger (red)

GitHub doesn’t have a success equivalent — use {{< notice success >}} for that.

Nested callouts

A callout inside a callout sheds its box and gets a coloured vertical strip on the left edge — like a margin mark. The inner keeps its own type color so the reader still sees whether it’s a tip, an info, a warning, etc.; the type icon sits at the top of the strip as the visual anchor. Works for any combination of types, on either authoring path ({{% notice %}} or > [!TYPE] blockquote), and cascades to arbitrary nesting depth.

Persona

Putting your SRE hat back on, you’d love to spot these database issues without having to log in and poke around.

Info

Wouldn’t it be great if we could have 24/7 monitoring of every database query — and be alerted the moment something starts drifting?

markdown
{{% notice icon="user" style="orange" title="Persona" %}}
Putting your SRE hat back on...

> [!IMPORTANT]
> Wouldn't it be great if we could have 24/7 monitoring...
{{% /notice %}}

Purely a visual treatment — no shortcode change. The CSS picks it up because the inner .callout literally lives inside the outer’s .callout__body; the descendant selector handles it. Deep nesting (3+ levels) keeps cascading.

Severity ladder

Visual weight escalates with severity — pick the right type and the page does the right thing automatically:

TypeVisual treatment
note / tip / info / successSoft tinted background (~7–10%), coloured left rule, small icon disc. The “quiet end” — sits next to prose without shouting.
warningLouder background (~16%), hairline perimeter border on top of the 5px left rule. Reads as “stop and read before continuing”.
dangerFull saturated red bg, white title + body + icon, soft drop shadow. Reserved for irreversible actions — data loss, prod side-effects, things you cannot undo.

Use danger sparingly. Its visual cost is high by design; if everything’s an emergency, nothing is. A workshop with two genuine danger blocks across 40 pages has them land properly. A workshop with twenty does not.

When to use which

SituationUse
Helpful tip, shortcutnotice tip
Quiet aside, footnotenotice note
Reference value, version notenotice info
Be careful, common mistakenotice warning
Will break, lose data, irreversiblenotice danger
Confirms something workednotice success

Callouts are noisy. Use them sparingly — three per page is the sweet spot, six is too many. If you find yourself reaching for a callout to highlight every paragraph, your prose is doing the wrong job.

Nest sparingly

Even with the strip-mark styling, a callout-inside-a-callout signals “this is a special aside on a special aside” — usually you want a list or a step instead. Save nesting for the cases where the inner content is genuinely a different kind of thing (a Persona framing wrapping an Important question, for example).
Last Modified ·