Hugo Shortcodes
Shortcodes are Hugo-specific template functions you call from markdown. scribe provides a shortcode dialog that generates the correct syntax for you.
Defining shortcodes
Section titled “Defining shortcodes”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 }Using shortcodes in the editor
Section titled “Using shortcodes in the editor”- In advanced mode, click a shortcode button in the toolbar
- Or click + shortcode to see all available shortcodes
- Fill in the fields and click Sett inn
- The shortcode syntax is inserted at the cursor position
Shortcode syntax generated
Section titled “Shortcode syntax generated”{{< youtube id="dQw4w9WgXcQ" >}}{{< callout type="info" text="This is a note" >}}Icon field
Section titled “Icon field”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