Skip to content

Hugo Shortcodes

Shortcodes are Hugo-specific template functions you call from markdown. scribe provides a shortcode dialog that generates the correct syntax for you.

Add shortcodes to data/scribe.yaml:

shortcodes:
- name: youtube
label: YouTube Video
icon: player-play
fields:
- { name: id, label: Video ID, type: string }
- name: callout
label: Callout box
icon: info-circle
fields:
- { name: type, label: Type (info/warn/danger), type: string }
- { name: text, label: Text, type: string }
  1. In advanced mode, click a shortcode button in the toolbar
  2. Or click + shortcode to see all available shortcodes
  3. Fill in the fields and click Sett inn
  4. The shortcode syntax is inserted at the cursor position
{{< youtube id="dQw4w9WgXcQ" >}}
{{< callout type="info" text="This is a note" >}}

The optional icon field uses Tabler Icons names. If omitted, a generic code icon is shown.

Common icons: player-play, photo, info-circle, link, code, list