Shortcodes

Layout helpers

Tabs, terminal, kbd, files, trees, images, badges, buttons, cards.

The visual building blocks for non-prose content — anything you’d want to break into columns, a labeled chip, or a visually distinct block.

Tabs #

A simple tab block:

bash
brew install hugo
markdown
{{< tabs >}}
{{< tab "macOS" >}} ... {{< /tab >}}
{{< tab "Linux" >}} ... {{< /tab >}}
{{< /tabs >}}

Tabs with groupid (synced) #

When a workshop has many tab blocks for the same axis (OS, language, environment), pass a shared groupid and they’ll stay in sync — picking “Linux” once selects it everywhere.

This pane is synced with the next one.
Switch the tab above and watch this one follow.

The selection is persisted in localStorage per groupid, so the user’s choice survives across pages.

Terminal #

zsh
npm install added 142 packages in 6s npm run dev > server listening on http://localhost:3000
markdown
{{< terminal title="zsh" >}}
$ npm install
added 142 packages in 6s
$ npm run dev
> server listening on http://localhost:3000
{{< /terminal >}}

Lines starting with $ get a styled prompt; everything else renders as output. The blinking cursor is decorative.

Keyboard shortcuts #

Open the command palette with Cmd+Shift+P on macOS, or Ctrl+Shift+P on Linux/Windows. Press ? to view all shortcuts.

markdown
Open the command palette with {{< kbd "Cmd+Shift+P" >}} on macOS.

Single keys, key combinations with +, single Unicode keys all work.

Inline filenames #

Edit config/server.yaml , then run the migration described in scripts/migrate.sh .

markdown
Edit {{< file "config/server.yaml" >}}, then run the migration described in
{{< file "scripts/migrate.sh" >}}.

A small dot-prefixed pill that visually separates filenames from prose.

File tree #

project/
├── src/
│   ├── index.ts
│   └── lib/
│       └── format.ts
├── tests/
│   └── format.test.ts
├── package.json
└── README.md
markdown
{{< file-tree >}}
project/
├── src/
│   └── index.ts
├── package.json
└── README.md
{{< /file-tree >}}

Paste output from the tree command directly. Lines containing / are highlighted as directories.

Image with caption + zoom #

Dashboard
Click any image to zoom — figures auto-number across the page.
markdown
{{< image src="dashboard.png" alt="Dashboard" caption="Click any image to zoom." >}}

image resolves the src against the page’s resources first, then falls back to a relative URL. Add align="left" / "right" / "bleed" for floated or full-bleed variants.

figure alias #

Hugo’s built-in shortcode name is figure, and content from other Hugo themes often uses it. This theme aliases figure to the same renderer as image so migrated content works without rewrites:

markdown
{{< figure src="dashboard.png" alt="Dashboard" caption="Same render as `image`." >}}

Prefer image for new content (it’s the documented name); figure is the compatibility surface.

Badges #

Small inline pills for status, version markers, environment labels, and the like. Use them in workshop-meta rows, alongside titles, or as terse “this only applies to X” annotations.

Color presets #

The theme ships six tonal presets that map onto the same palette as the callouts:

default NEW stable passing deprecated breaking

markdown
{{< badge >}}default{{< /badge >}}
{{< badge color="accent" >}}NEW{{< /badge >}}
{{< badge color="info" >}}stable{{< /badge >}}
{{< badge color="success" >}}passing{{< /badge >}}
{{< badge color="warn" >}}deprecated{{< /badge >}}
{{< badge color="danger" >}}breaking{{< /badge >}}

Custom hex / CSS colors #

Pass any CSS color (hex, rgb(), named) to break out of the presets:

custom hex cyan-700 rebecca

markdown
{{< badge color="#7c3aed" >}}custom hex{{< /badge >}}

The CSS recipe used internally is color-mix(in oklab, <yourColor> 40%, transparent) for the border, 10% for the background, plus the full color for the text — so any color you pass produces a balanced tonal pill without you having to specify each surface.

With a leading title pill #

The title attribute renders a small label to the LEFT of the content, separated by a hairline. Useful for key: value-style metadata:

version9.2.1 statusactive cipassing envstaging

markdown
{{< badge color="accent" title="version" >}}9.2.1{{< /badge >}}
{{< badge color="info" title="status" >}}active{{< /badge >}}

With an icon #

Prefix the label with an icon from the bundled icon set (see Icons below):

fast secure verified heads-up

markdown
{{< badge color="accent" icon="rocket" >}}fast{{< /badge >}}
{{< badge color="info" icon="shield" >}}secure{{< /badge >}}

Combined: title + icon + content #

All three modifiers compose:

APIstable docsup to date

markdown
{{< badge color="accent" title="API" icon="check" >}}stable{{< /badge >}}

Badge parameters #

ParamDefaultNotes
(inner content)The visible label. Markdown allowed (e.g. `code`, bold, links).
colorEither a preset name (accent, info, success, warn, danger, primary, secondary) or any CSS color value.
styleAlias of color (relearn-compatibility).
titleOptional label rendered to the left of the content, separated by a hairline.
iconOptional icon name from the bundled set, rendered to the left of the title (or content if no title).

When to reach for a badge #

NeedExample
Mark a feature as new / experimentalBETA next to a section heading
Show a version requirementrequires≥ 1.2.0
Flag a deprecated pathdeprecated inline in prose
Status of a build / test / pipeline passing
Environment annotationenvstaging

What badges aren’t #

Buttons #

The theme ships two button shortcodes for two distinct jobs. Pick the right one:

ShortcodeVisualUse for
{{< button >}}Small inline pill, configurable colourInline page content, prose, multi-button rows. Relearn-compatible .
{{< cta >}}Big gradient Splunk-branded pill with shadowHero / landing / end-of-workshop primary actions. One per section.

button — inline (relearn-compatible) #

Small linkable pill. Drop-in replacement for the relearn button — same param names, same semantic style presets, same colour aliases. The default is a neutral white/clear pill; opt into a coloured fill via style="primary" (Splunk magenta) or any semantic preset.

Read the docs Get started View on GitHub Download

markdown
{{< button href="#" icon="book-open" >}}Read the docs{{< /button >}}
{{< button href="#" icon="rocket" style="primary" >}}Get started{{< /button >}}
{{< button href="#" icon="github" style="secondary" target="_blank" >}}View on GitHub{{< /button >}}
{{< button href="#" icon="download" style="transparent" >}}Download{{< /button >}}

Button parameters #

ParamDefaultNotes
hrefTarget URL. If omitted, renders as a <button type="button"> (no link).
styledefaultSemantic preset OR any CSS colour. See table below.
colorExplicit CSS colour. Wins over style colour. Any CSS colour (#hex, rgb(), named).
iconIcon name from the bundled set. Renders to the left of the label by default.
iconpositionleftleft or right.
target_blank to open in a new tab; auto-adds rel="noopener".
titleFallback label if the inner text is empty.

Style presets #

style=Result
default (default)Neutral white/clear surface with a subtle border.
primaryFilled accent fill (Splunk magenta).
secondaryOutlined — accent border + label, transparent fill.
transparentText-only — no border or background.
success warning error info note tipSemantic colour fills.
blue green orange yellow red grayRelearn colour aliases .
Any CSS colourUsed as the fill (style="purple", style="#7f00ff").

Variations #

Outline + icon-right (good for “continue” affordances):

Continue

Coloured presets:

Success Warning Error

Custom colour:

Custom

cta — the big Splunk pill #

A bold gradient call-to-action pill (extra padding, shadow, arrow). Use sparingly — one primary cta per page section, on landing or end-of-workshop pages. For inline page content, reach for button instead.

Start the workshop
markdown
{{< cta href="#" icon="rocket" >}}Start the workshop{{< /cta >}}

CTA parameters #

ParamDefaultNotes
hrefTarget URL. If omitted, renders as a <button type="button">.
styleprimaryprimary (gradient fill) or secondary / ghost / transparent (outline).
iconIcon name. If omitted, the pill emits a arrow at the end.
iconpositionleftleft or right.
target_blank to open in a new tab; auto-adds rel="noopener".
titleFallback label if the inner text is empty.

Icons #

The theme ships a curated set of ~40 inline SVG icons sourced from Lucide . They’re rendered via the icon shortcode or referenced by name from button, card, badge, and tab.

Inline use #

Icons inherit currentColor so they pick up the surrounding text color:

security · performance · community · ideas

markdown
{{< icon "shield" >}} security · {{< icon "rocket" >}} performance

Custom color #

Pass an explicit CSS color to override:

brand-pink heart · amber star · green check

markdown
{{< icon icon="heart" color="#FF007F" >}}

Note that the icon shortcode takes either a single positional arg ({{< icon "name" >}}) or named args ({{< icon icon="name" color="..." >}}) — Hugo doesn’t allow mixing positional and named on the same call.

The icon set #

The bundled set covers the cases you’ll most often hit in workshop content:

Common Font Awesome aliases are accepted too: fas-check, fa-circle-info, external-link, etc.

Adding your own icons #

To register a new icon, edit layouts/partials/icon-svg.html (override it in your own site to keep your changes outside the theme). Drop a new entry into the $icons dict — paste the SVG path data only, without the <svg> wrapper:

go-html-template
"my-icon" `<path d="M3 12h18M12 3l9 9-9 9" stroke-linecap="round"/>`

The wrapper auto-applies viewBox="0 0 24 24", stroke="currentColor", and 2px stroke. So your SVG path data should be designed for a 24×24 grid with no inline color.

Source for new icons

Lucide and Phosphor both ship 24×24 SVGs with consistent stroke widths that drop straight in. Copy the path data, paste into the dict, restart hugo server.

Cards #

A grid of cards via the cards container:

markdown
{{< cards >}}
{{< card title="Install" href="/install/" icon="download" >}}
Set up the theme...
{{< /card >}}
{{< card title="Customize" href="/customize/" icon="settings" >}}
Rebrand colors, fonts, and logo.
{{< /card >}}
{{< /cards >}}

A standalone card outside a cards container renders as a single full-width content card.

Indicators #

20 min   Intermediate

markdown
{{< time "20 min" >}} &nbsp; {{< difficulty 3 >}}

Useful in workshop meta rows or as inline annotations. difficulty accepts 1–5.

Last Modified ·