Skip to main content
Chapter 4

Shortcodes

Hugo uses Markdown as its content format. However, there are a lot of things that Markdown doesn’t support well. To overcome those limitations, Hugo created the concept of shortcodes.

On top of Hugo’s built-in shortcodes the Relearn theme supplies the following additional shortcodes.

Subsections of Shortcodes

Badge

The badge shortcode displays colorful markers in your text with optional icons.

Important Version6.6.6 Captain InfoNew Awesome

Usage

​
{{% badge %}}Important{{% /badge %}}
{{% badge style="primary" title="Version" %}}6.6.6{{% /badge %}}
{{% badge icon="angle-double-up" style="red" %}}Captain{{% /badge %}}
{{% badge style="info" %}}New{{% /badge %}}
{{% badge color="fuchsia" icon="fa-fw fab fa-hackerrank" %}}Awesome{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Important"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "6.6.6"
  "style" "primary"
  "title" "Version"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Captain"
  "icon" "angle-double-up"
  "style" "red"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "New"
  "style" "info"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "color" "fuchsia"
  "content" "Awesome"
  "icon" "fa-fw fab fa-hackerrank"
)}}

Parameters

Name Default Notes
style default The style scheme used for the badge.

- by severity: caution, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code, link, action, inline

You can also define your own styles.
color see notes The CSS color value to be used. If not set, the chosen color depends on the style. Any given value will overwrite the default.

- for severity styles: a nice matching color for the severity
- for all other styles: the corresponding color
title see notes Arbitrary text for the badge title. Depending on the style there may be a default title. Any given value will overwrite the default.

- for severity styles: the matching title for the severity
- for all other styles: <empty>

If you want no title for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)
icon see notes Font Awesome icon name set to the left of the title. Depending on the style there may be a default icon. Any given value will overwrite the default.

- for severity styles: a nice matching icon for the severity
- for all other styles: <empty>

If you want no icon for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)
<content> <empty> Arbitrary text for the badge.

Examples

Style

By Severity

​
{{% badge style="caution" %}}Magenta{{% /badge %}}
{{% badge style="important" %}}Cyan{{% /badge %}}
{{% badge style="info" %}}Blue{{% /badge %}}
{{% badge style="note" %}}Orange{{% /badge %}}
{{% badge style="tip" %}}Green{{% /badge %}}
{{% badge style="warning" %}}Red{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Magenta"
  "style" "caution"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Cyan"
  "style" "important"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Blue"
  "style" "info"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Orange"
  "style" "note"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Green"
  "style" "tip"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Red"
  "style" "warning"
)}}
CautionMagenta ImportantCyan InfoBlue NoteOrange TipGreen WarningRed

By Brand Colors

​
{{% badge icon="bullhorn" style="primary" title="Announcement" %}}Mandatory{{% /badge %}}
{{% badge icon="bullhorn" style="secondary" title="Announcement" %}}Optional{{% /badge %}}
{{% badge icon="bullhorn" style="accent" title="Announcement" %}}Special{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Mandatory"
  "icon" "bullhorn"
  "style" "primary"
  "title" "Announcement"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Optional"
  "icon" "bullhorn"
  "style" "secondary"
  "title" "Announcement"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Special"
  "icon" "bullhorn"
  "style" "accent"
  "title" "Announcement"
)}}
AnnouncementMandatory AnnouncementOptional AnnouncementSpecial

By Color

​
{{% badge icon="palette" style="blue" title="Color" %}}Blue{{% /badge %}}
{{% badge icon="palette" style="cyan" title="Color" %}}Cyan{{% /badge %}}
{{% badge icon="palette" style="green" title="Color" %}}Green{{% /badge %}}
{{% badge icon="palette" style="grey" title="Color" %}}Grey{{% /badge %}}
{{% badge icon="palette" style="magenta" title="Color" %}}Magenta{{% /badge %}}
{{% badge icon="palette" style="orange" title="Color" %}}Orange{{% /badge %}}
{{% badge icon="palette" style="red" title="Color" %}}Red{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Blue"
  "icon" "palette"
  "style" "blue"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Cyan"
  "icon" "palette"
  "style" "cyan"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Green"
  "icon" "palette"
  "style" "green"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Grey"
  "icon" "palette"
  "style" "grey"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Magenta"
  "icon" "palette"
  "style" "magenta"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Orange"
  "icon" "palette"
  "style" "orange"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Red"
  "icon" "palette"
  "style" "red"
  "title" "Color"
)}}
ColorBlue ColorCyan ColorGreen ColorGrey ColorMagenta ColorOrange ColorRed

By Special Color

​
{{% badge icon="palette" style="default" title="Color" %}}Default{{% /badge %}}
{{% badge icon="palette" style="transparent" title="Color" %}}Transparent{{% /badge %}}
{{% badge icon="palette" style="code" title="Color" %}}Code{{% /badge %}}
{{% badge icon="palette" style="link" title="Color" %}}Link{{% /badge %}}
{{% badge icon="palette" style="action" title="Color" %}}Action{{% /badge %}}
{{% badge icon="palette" style="inline" title="Color" %}}Inline{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Default"
  "icon" "palette"
  "style" "default"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Transparent"
  "icon" "palette"
  "style" "transparent"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Code"
  "icon" "palette"
  "style" "code"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Link"
  "icon" "palette"
  "style" "link"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Action"
  "icon" "palette"
  "style" "action"
  "title" "Color"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Inline"
  "icon" "palette"
  "style" "inline"
  "title" "Color"
)}}
ColorDefault ColorTransparent ColorCode ColorLink ColorAction ColorInline

Variants

Without Icon and Title Text

​
{{% badge %}}6.6.6{{% /badge %}}
{{% badge icon=" " style="info" title=" " %}}Awesome{{% /badge %}}
{{% badge style="red" %}}Captain{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "6.6.6"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Awesome"
  "icon" " "
  "style" "info"
  "title" " "
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Captain"
  "style" "red"
)}}
6.6.6 Awesome Captain

Without Icon

​
{{% badge title="Version" %}}6.6.6{{% /badge %}}
{{% badge icon=" " style="info" %}}Awesome{{% /badge %}}
{{% badge style="red" title="Rank" %}}Captain{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "6.6.6"
  "title" "Version"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Awesome"
  "icon" " "
  "style" "info"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Captain"
  "style" "red"
  "title" "Rank"
)}}
Version6.6.6 InfoAwesome RankCaptain

Without Title Text

​
{{% badge icon="star" %}}6.6.6{{% /badge %}}
{{% badge style="info" title=" " %}}Awesome{{% /badge %}}
{{% badge icon="angle-double-up" style="red" %}}Captain{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "6.6.6"
  "icon" "star"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Awesome"
  "style" "info"
  "title" " "
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Captain"
  "icon" "angle-double-up"
  "style" "red"
)}}
6.6.6 Awesome Captain

All Set

​
{{% badge icon="star" title="Version" %}}6.6.6{{% /badge %}}
{{% badge style="info" %}}Awesome{{% /badge %}}
{{% badge icon="angle-double-up" style="red" title="Rank" %}}Captain{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "6.6.6"
  "icon" "star"
  "title" "Version"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Awesome"
  "style" "info"
)}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Captain"
  "icon" "angle-double-up"
  "style" "red"
  "title" "Rank"
)}}
Version6.6.6 InfoAwesome RankCaptain

Override for Severity

​
{{% badge icon="rocket" style="info" title="Feature" %}}Awesome{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Awesome"
  "icon" "rocket"
  "style" "info"
  "title" "Feature"
)}}
FeatureAwesome

Other

With User-Defined Color, Font Awesome Brand Icon and Markdown Title and Content

​
{{% badge color="fuchsia" icon="fa-fw fab fa-hackerrank" title="**Font**" %}}**Awesome**{{% /badge %}}
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "color" "fuchsia"
  "content" "**Awesome**"
  "icon" "fa-fw fab fa-hackerrank"
  "title" "**Font**"
)}}
FontAwesome

With Icon Content

You can combine the badge with the icon shortcode to create even more stunning visuals.

In this case you need to declare {{< badge >}} instead of {{% badge %}}. Note, that in this case it is not possible to put markdown in the content.

​
{{< badge icon="angle-double-up" style="primary" >}}{{% icon icon="skull-crossbones" /%}}{{< /badge >}}  
{{< badge icon="angle-double-up" style="primary" >}}{{% icon icon="skull-crossbones" /%}} Pirate{{< /badge >}}  
{{< badge style="primary" title="Rank" >}}{{% icon icon="skull-crossbones" /%}}{{< /badge >}}  
{{< badge style="primary" title="Rank" >}}{{% icon icon="skull-crossbones" /%}} Pirate{{< /badge >}}  
{{< badge icon="angle-double-up" style="primary" title="Rank" >}}{{% icon icon="skull-crossbones" /%}}{{< /badge >}}  
{{< badge icon="angle-double-up" style="primary" title="Rank" >}}{{% icon icon="skull-crossbones" /%}} Pirate{{< /badge >}}  
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "icon" "angle-double-up"
  "content" (partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "skull-crossbones"
  ))
  "style" "primary"
)}}  
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "icon" "angle-double-up"
  "content" (partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "skull-crossbones"
  ))
  "style" "primary"
)}}  
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" (partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "skull-crossbones"
  ))
  "style" "primary"
  "title" "Rank"
)}}  
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" (partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "skull-crossbones"
  ))
  "style" "primary"
  "title" "Rank"
)}}  
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "icon" "angle-double-up"
  "content" (partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "skull-crossbones"
  ))
  "style" "primary"
  "title" "Rank"
)}}  
{{ partial "shortcodes/badge.html" (dict
  "page" .
  "icon" "angle-double-up"
  "content" (partial "shortcodes/icon.html" (dict
    "page" .
    "icon" "skull-crossbones"
  ))
  "style" "primary"
  "title" "Rank"
)}}  

Pirate
Rank
Rank Pirate
Rank
Rank Pirate

Inside of Text

​
Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. {{% badge icon="rocket" style="blue" %}}Awesome{{% /badge %}} Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.
Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. {{ partial "shortcodes/badge.html" (dict
  "page" .
  "content" "Awesome"
  "icon" "rocket"
  "style" "blue"
)}} Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.
Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Awesome Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.

Button

The button shortcode displays a clickable button with adjustable color, title and icon.

Go Hugo Download Magic

Usage

​
{{% button href="https://gohugo.io/" %}}Go Hugo{{% /button %}}
{{% button href="images/magic.gif?download" icon="hand-sparkles" style="tip" %}}Download Magic{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Go Hugo"
  "href" "https://gohugo.io/"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Download Magic"
  "href" "images/magic.gif?download"
  "icon" "hand-sparkles"
  "style" "tip"
)}}

Parameters

Name Default Notes
href <empty> Either the destination URL for the button or JavaScript code to be executed on click. If this parameter is not set, the button will do nothing but is still displayed as clickable.

- if starting with javascript: all following text will be executed in your browser
- every other string will be interpreted as URL, you can use link effects as well.
action <empty> Name of an action executed by your own script on click, without inline JavaScript. Use this instead of a JavaScript href if your site uses a strict Content Security Policy. See example.
type see notes The button type if href is JavaScript or action is set. Otherwise the parameter is not used. If the parameter is not given it defaults to button.
istoggle false When true, the button announces to assistive technology that it shows and hides something. It starts as hidden and the theme changes the state with each click. Only used if href is JavaScript or action is set. See example.
borderless false When true, no border will be shown around the button.
hint <empty> Tooltip for the button.
style transparent The style scheme used for the button.

- by severity: caution, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code, link, action, inline

You can also define your own styles.
color see notes The CSS color value to be used. If not set, the chosen color depends on the style. Any given value will overwrite the default.

- for severity styles: a nice matching color for the severity
- for all other styles: the corresponding color
icon see notes Font Awesome icon name set to the left of the title. Depending on the style there may be a default icon. Any given value will overwrite the default.

- for severity styles: a nice matching icon for the severity
- for all other styles: <empty>

If you want no icon for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)
iconposition left Places the icon to the left or right of the title.
<content> see notes Arbitrary text for the button title. Depending on the style there may be a default title. Any given value will overwrite the default.

- for severity styles: the matching title for the severity
- for all other styles: <empty>

If you want no title for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)

Examples

Style

By Severity

​
{{% button href="https://gohugo.io/" style="caution" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="important" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="info" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="note" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="tip" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="warning" %}}Get Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "caution"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "important"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "info"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "note"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "tip"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "warning"
)}}
Get Hugo Get Hugo Get Hugo Get Hugo Get Hugo Get Hugo

By Brand Colors

​
{{% button href="https://gohugo.io/" style="primary" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="secondary" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="accent" %}}Get Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "primary"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "secondary"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "accent"
)}}
Get Hugo Get Hugo Get Hugo

By Color

​
{{% button href="https://gohugo.io/" style="blue" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="cyan" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="green" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="grey" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="magenta" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="orange" %}}Get Hugo{{% /button %}}
{{% button href="https://gohugo.io/" style="red" %}}Get Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "blue"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "cyan"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "green"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "grey"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "magenta"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "orange"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "red"
)}}
Get Hugo Get Hugo Get Hugo Get Hugo Get Hugo Get Hugo Get Hugo

By Special Color

​
{{% button href="https://gohugo.io/" style="default" %}}Open Link{{% /button %}}
{{% button href="https://gohugo.io/" style="transparent" %}}Open Link{{% /button %}}
{{% button href="https://gohugo.io/" style="code" %}}Open Link{{% /button %}}
{{% button href="https://gohugo.io/" style="link" %}}Open Link{{% /button %}}
{{% button href="https://gohugo.io/" style="action" %}}Open Link{{% /button %}}
{{% button href="https://gohugo.io/" style="inline" %}}Open Link{{% /button %}}

{{% button href="javascript:alert('Some JavaScript')" style="default" %}}Run JavaScript{{% /button %}}
{{% button href="javascript:alert('Some JavaScript')" style="transparent" %}}Run JavaScript{{% /button %}}
{{% button href="javascript:alert('Some JavaScript')" style="code" %}}Run JavaScript{{% /button %}}
{{% button href="javascript:alert('Some JavaScript')" style="link" %}}Run JavaScript{{% /button %}}
{{% button href="javascript:alert('Some JavaScript')" style="action" %}}Run JavaScript{{% /button %}}
{{% button href="javascript:alert('Some JavaScript')" style="inline" %}}Run JavaScript{{% /button %}}

{{% button style="default" %}}Fake Button{{% /button %}}
{{% button style="transparent" %}}Fake Button{{% /button %}}
{{% button style="code" %}}Fake Button{{% /button %}}
{{% button style="link" %}}Fake Button{{% /button %}}
{{% button style="action" %}}Fake Button{{% /button %}}
{{% button style="inline" %}}Fake Button{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Open Link"
  "href" "https://gohugo.io/"
  "style" "default"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Open Link"
  "href" "https://gohugo.io/"
  "style" "transparent"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Open Link"
  "href" "https://gohugo.io/"
  "style" "code"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Open Link"
  "href" "https://gohugo.io/"
  "style" "link"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Open Link"
  "href" "https://gohugo.io/"
  "style" "action"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Open Link"
  "href" "https://gohugo.io/"
  "style" "inline"
)}}

{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Run JavaScript"
  "href" "javascript:alert('Some JavaScript')"
  "style" "default"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Run JavaScript"
  "href" "javascript:alert('Some JavaScript')"
  "style" "transparent"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Run JavaScript"
  "href" "javascript:alert('Some JavaScript')"
  "style" "code"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Run JavaScript"
  "href" "javascript:alert('Some JavaScript')"
  "style" "link"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Run JavaScript"
  "href" "javascript:alert('Some JavaScript')"
  "style" "action"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Run JavaScript"
  "href" "javascript:alert('Some JavaScript')"
  "style" "inline"
)}}

{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Fake Button"
  "style" "default"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Fake Button"
  "style" "transparent"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Fake Button"
  "style" "code"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Fake Button"
  "style" "link"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Fake Button"
  "style" "action"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Fake Button"
  "style" "inline"
)}}

Open Link Open Link Open Link Open Link Open Link Open Link

Fake Button Fake Button Fake Button Fake Button Fake Button Fake Button

Icon

Empty

​
{{% button hint="Go Hugo" href="https://gohugo.io/" icon=" " %}}{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" ""
  "hint" "Go Hugo"
  "href" "https://gohugo.io/"
  "icon" " "
)}}

Only with Hint

Mouse-over the button to see the hint.

​
{{% button hint="Go to Hugo's homepage" href="https://gohugo.io/" icon="download" %}}{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" ""
  "hint" "Go to Hugo's homepage"
  "href" "https://gohugo.io/"
  "icon" "download"
)}}

To the Left

​
{{% button href="https://gohugo.io/" icon="download" %}}Get Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "icon" "download"
)}}
Get Hugo

To the Right

​
{{% button href="https://gohugo.io/" icon="download" iconposition="right" %}}Get Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "icon" "download"
  "iconposition" "right"
)}}
Get Hugo

Override for Severity

​
{{% button href="https://gohugo.io/" icon="dragon" style="warning" %}}Get Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "icon" "dragon"
  "style" "warning"
)}}
Get Hugo

You can use link effects with your href to open the link in a different tab or starting a download.

​
{{% button href="https://gohugo.io/?target=_blank" %}}Go Hugo{{% /button %}}
{{% button href="images/magic.gif?download" icon="hand-sparkles" style="tip" %}}Download Magic{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Go Hugo"
  "href" "https://gohugo.io/?target=_blank"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Download Magic"
  "href" "images/magic.gif?download"
  "icon" "hand-sparkles"
  "style" "tip"
)}}
Go Hugo Download Magic

Other

Borderless

​
{{% button borderless="true" href="https://gohugo.io/" style="primary" %}}Get Hugo{{% /button %}}
{{% button borderless="true" href="https://gohugo.io/" style="default" %}}Get Hugo{{% /button %}}
{{% button borderless="true" href="https://gohugo.io/" style="transparent" %}}Get Hugo{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "borderless" "true"
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "primary"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "borderless" "true"
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "default"
)}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "borderless" "true"
  "content" "Get Hugo"
  "href" "https://gohugo.io/"
  "style" "transparent"
)}}
Get Hugo Get Hugo Get Hugo

With User-Defined Color, Font Awesome Brand Icon and Markdown Title

​
{{% button color="fuchsia" href="https://gohugo.io/" icon="fa-fw fab fa-hackerrank" %}}Get **Hugo**{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "color" "fuchsia"
  "content" "Get **Hugo**"
  "href" "https://gohugo.io/"
  "icon" "fa-fw fab fa-hackerrank"
)}}
Get Hugo

Severity Style with All Defaults

​
{{% button href="https://gohugo.io/" style="tip" %}}{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" ""
  "href" "https://gohugo.io/"
  "style" "tip"
)}}
Tip

Button to Internal Page

​
{{% button href="/index.html" %}}Home{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Home"
  "href" "/index.html"
)}}
Home

Button with JavaScript Action

If your JavaScript action does not change the focus afterwards, make sure to call this.blur() in the end to unselect the button.

​
{{% button href="javascript:alert('Hello world!');this.blur();" icon="bullhorn" style="primary" %}}Shout it out{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "content" "Shout it out"
  "href" "javascript:alert('Hello world!');this.blur();"
  "icon" "bullhorn"
  "style" "primary"
)}}

Button with Own Action

The button is written with a data-button-action attribute. Handle it in your assets/js/custom.js, which the theme loads on every page.

​
{{% button action="shout" icon="bullhorn" style="primary" %}}Shout it out{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "action" "shout"
  "content" "Shout it out"
  "icon" "bullhorn"
  "style" "primary"
)}}
​
document.addEventListener('click', function (event) {
  var button = event.target.closest('button[data-button-action="shout"]');
  if (button) {
    alert('Hello world!');
    button.blur();
  }
});

Toggle Button

If your button shows and hides something, set istoggle. The button is written with an aria-expanded attribute telling assistive technology whether the thing is shown, and the theme flips it with each click.

​
{{% button action="details" icon="eye" istoggle="true" %}}Details{{% /button %}}
{{ partial "shortcodes/button.html" (dict
  "page" .
  "action" "details"
  "content" "Details"
  "icon" "eye"
  "istoggle" "true"
)}}

Your script reads the attribute to know what to do. The theme has flipped it by the time your listener runs, so it already tells the new state.

​
document.addEventListener('click', function (event) {
  var button = event.target.closest('button[data-button-action="details"]');
  if (button) {
    var show = button.getAttribute('aria-expanded') == 'true';
    document.querySelector('#my-details').hidden = !show;
  }
});

If what you show can also be hidden by other means than the button, your script has to set the attribute itself in that case.

Button within a form Element

To use native HTML elements in your Markdown, add this in your hugo.toml

hugo.
[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true
markup:
  goldmark:
    renderer:
      unsafe: true
{
   "markup": {
      "goldmark": {
         "renderer": {
            "unsafe": true
         }
      }
   }
}
<form action="../../search/index.html" method="get">
  <input name="search-by" class="search-by" type="search">
  {{% button type="submit" style="secondary" icon="search" %}}Search{{% /button %}}
</form>

Callout

The callout shortcode shows boxes with configurable color, title and icon.

There may be pirates
It is all about the boxes.

Usage

​
> [!primary] There may be pirates
> It is all about the boxes.
{icon="skull-crossbones"}
{{% callout icon="skull-crossbones" style="primary" title="There may be pirates" %}}
It is all about the boxes.
{{% /callout %}}
{{% callout "primary" "There may be pirates" "skull-crossbones" %}}
It is all about the boxes.
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "It is all about the boxes."
  "icon" "skull-crossbones"
  "style" "primary"
  "title" "There may be pirates"
)}}

If you want to display a transparent expandable box without any border, you can also use the details shortcode.

Parameters

Name Position Default Notes
groupid <empty> Arbitrary name of the group the box belongs to.

Expandable boxes with the same groupid synchronize their open state.
style 1 default The style scheme used for the box.

- by severity: caution, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code, link, action, inline

You can also define your own styles.
color see notes The CSS color value to be used. If not set, the chosen color depends on the style. Any given value will overwrite the default.

- for severity styles: a nice matching color for the severity
- for all other styles: the corresponding color
title 2 see notes Arbitrary text for the box title. Depending on the style there may be a default title. Any given value will overwrite the default.

- for severity styles: the matching title for the severity
- for all other styles: <empty>

If you want no title for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)
icon 3 see notes Font Awesome icon name set to the left of the title. Depending on the style there may be a default icon. Any given value will overwrite the default.

- for severity styles: a nice matching icon for the severity
- for all other styles: <empty>

If you want no icon for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)
expanded <empty> Whether to draw an expander and how the content is displayed.

- <empty>: no expander is drawn and the content is permanently shown
- true: the expander is drawn and the content is initially shown
- false: the expander is drawn and the content is initially hidden
hint <empty> Tooltip for the title of the box.
<content> <empty> Arbitrary text to be displayed in box.

Settings

Defining own Styles

Option Besides the predefined style values from above, you are able to define your own.

hugo.
[params]
  [[params.boxStyle]]
    color = 'violet'
    i18n = ''
    icon = 'hand-sparkles'
    identifier = 'magic'
    title = 'Magic'

  [[params.boxStyle]]
    icon = 'plus-circle'
    identifier = 'new'
    style = 'info'
    title = ' '
params:
  boxStyle:
  - color: violet
    i18n: ''
    icon: hand-sparkles
    identifier: magic
    title: Magic
  - icon: plus-circle
    identifier: new
    style: info
    title: ' '
{
   "params": {
      "boxStyle": [
         {
            "color": "violet",
            "i18n": "",
            "icon": "hand-sparkles",
            "identifier": "magic",
            "title": "Magic"
         },
         {
            "icon": "plus-circle",
            "identifier": "new",
            "style": "info",
            "title": " "
         }
      ]
   }
}
Name Default Notes
identifier <empty> This must match the style parameter used in a shortcode.
style <empty> If you define this optional parameter, this is where default values for title, icon and color are taken from if style exists beforehand. You can reference predefined styles as also your own styles.
title <empty> The default title used. If you have set style and don’t want any title at all, you have to set this parameter to " “. See the parameter i18n if you use multiple languages in your site.
i18n <empty> If no title is given but i18n is set, the title will be taken from the translation files by that key.
icon <empty> The default icon used. If you have set style and don’t want any icon at all, you have to set this parameter to " “.
color <empty> The default color used. If you have set style and don’t want any color at all, you have to set this parameter to " “.

Below is a usage example.

Markdown Attributes Configuration

The first line of the Markdown syntax only has room for style, title and expanded. The parameters color, icon, groupid and hint are written as Markdown attributes in a line following the callout instead, so Hugo’s block attributes are required if you use one of them in Markdown syntax.

hugo.
[markup]
  [markup.goldmark]
    [markup.goldmark.parser]
      [markup.goldmark.parser.attribute]
        block = true
markup:
  goldmark:
    parser:
      attribute:
        block: true
{
   "markup": {
      "goldmark": {
         "parser": {
            "attribute": {
               "block": true
            }
         }
      }
   }
}

Without it, Hugo doesn’t recognize the line, so it is printed as text below the box and the parameters are ignored. The shortcode and partial syntax work regardless.

See the example on how the attributes are written.

Examples

By Severity Using Markdown Callout Syntax

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

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

> [!info]
> Information that users <ins>_might_</ins> find interesting.

> [!note]
> Useful information that users should know, even when skimming content.

> [!tip]
> Helpful advice for doing things better or more easily.

> [!warning]
> Urgent info that needs immediate user attention to avoid problems.
{{% callout style="caution" %}}
Advises about risks or negative outcomes of certain actions.
{{% /callout %}}

{{% callout style="important" %}}
Key information users need to know to achieve their goal.
{{% /callout %}}

{{% callout style="info" %}}
Information that users <ins>_might_</ins> find interesting.
{{% /callout %}}

{{% callout style="note" %}}
Useful information that users should know, even when skimming content.
{{% /callout %}}

{{% callout style="tip" %}}
Helpful advice for doing things better or more easily.
{{% /callout %}}

{{% callout style="warning" %}}
Urgent info that needs immediate user attention to avoid problems.
{{% /callout %}}
{{% callout "caution" %}}
Advises about risks or negative outcomes of certain actions.
{{% /callout %}}

{{% callout "important" %}}
Key information users need to know to achieve their goal.
{{% /callout %}}

{{% callout "info" %}}
Information that users <ins>_might_</ins> find interesting.
{{% /callout %}}

{{% callout "note" %}}
Useful information that users should know, even when skimming content.
{{% /callout %}}

{{% callout "tip" %}}
Helpful advice for doing things better or more easily.
{{% /callout %}}

{{% callout "warning" %}}
Urgent info that needs immediate user attention to avoid problems.
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Advises about risks or negative outcomes of certain actions."
  "style" "caution"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Key information users need to know to achieve their goal."
  "style" "important"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Information that users <ins>_might_</ins> find interesting."
  "style" "info"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Useful information that users should know, even when skimming content."
  "style" "note"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Helpful advice for doing things better or more easily."
  "style" "tip"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Urgent info that needs immediate user attention to avoid problems."
  "style" "warning"
)}}
Caution
Advises about risks or negative outcomes of certain actions.
Important
Key information users need to know to achieve their goal.
Info
Information that users might find interesting.
Note
Useful information that users should know, even when skimming content.
Tip
Helpful advice for doing things better or more easily.
Warning
Urgent info that needs immediate user attention to avoid problems.

By Brand Colors with Title and Icon Variantion

​
> [!primary] Primary
> A **primary** disclaimer

> [!secondary] Secondary
> A **secondary** disclaimer

> [!accent]
> An **accent** disclaimer
{icon="stopwatch"}
{{% callout style="primary" title="Primary" %}}
A **primary** disclaimer
{{% /callout %}}

{{% callout style="secondary" title="Secondary" %}}
A **secondary** disclaimer
{{% /callout %}}

{{% callout icon="stopwatch" style="accent" %}}
An **accent** disclaimer
{{% /callout %}}
{{% callout "primary" "Primary" %}}
A **primary** disclaimer
{{% /callout %}}

{{% callout "secondary" "Secondary" %}}
A **secondary** disclaimer
{{% /callout %}}

{{% callout "accent" %}}
An **accent** disclaimer
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **primary** disclaimer"
  "style" "primary"
  "title" "Primary"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **secondary** disclaimer"
  "style" "secondary"
  "title" "Secondary"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "An **accent** disclaimer"
  "icon" "stopwatch"
  "style" "accent"
)}}
Primary
A primary disclaimer
Secondary
A secondary disclaimer
Details
An accent disclaimer

By Color

​
> [!blue] Blue
> A **blue** disclaimer

> [!cyan] Cyan
> A **cyan** disclaimer

> [!green] Green
> A **green** disclaimer

> [!grey]
> A **grey** disclaimer
{icon="bug"}

> [!magenta] Magenta
> A **magenta** disclaimer

> [!orange] Orange
> A **orange** disclaimer
{icon="bug"}

> [!red] Red
> A **red** disclaimer
{{% callout style="blue" title="Blue" %}}
A **blue** disclaimer
{{% /callout %}}

{{% callout style="cyan" title="Cyan" %}}
A **cyan** disclaimer
{{% /callout %}}

{{% callout style="green" title="Green" %}}
A **green** disclaimer
{{% /callout %}}

{{% callout icon="bug" style="grey" %}}
A **grey** disclaimer
{{% /callout %}}

{{% callout style="magenta" title="Magenta" %}}
A **magenta** disclaimer
{{% /callout %}}

{{% callout icon="bug" style="orange" title="Orange" %}}
A **orange** disclaimer
{{% /callout %}}

{{% callout style="red" title="Red" %}}
A **red** disclaimer
{{% /callout %}}
{{% callout "blue" "Blue" %}}
A **blue** disclaimer
{{% /callout %}}

{{% callout "cyan" "Cyan" %}}
A **cyan** disclaimer
{{% /callout %}}

{{% callout "green" "Green" %}}
A **green** disclaimer
{{% /callout %}}

{{% callout "grey" %}}
A **grey** disclaimer
{{% /callout %}}

{{% callout "magenta" "Magenta" %}}
A **magenta** disclaimer
{{% /callout %}}

{{% callout "orange" "Orange" "bug" %}}
A **orange** disclaimer
{{% /callout %}}

{{% callout "red" "Red" %}}
A **red** disclaimer
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **blue** disclaimer"
  "style" "blue"
  "title" "Blue"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **cyan** disclaimer"
  "style" "cyan"
  "title" "Cyan"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **green** disclaimer"
  "style" "green"
  "title" "Green"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **grey** disclaimer"
  "icon" "bug"
  "style" "grey"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **magenta** disclaimer"
  "style" "magenta"
  "title" "Magenta"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **orange** disclaimer"
  "icon" "bug"
  "style" "orange"
  "title" "Orange"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "A **red** disclaimer"
  "style" "red"
  "title" "Red"
)}}
Blue
A blue disclaimer
Cyan
A cyan disclaimer
Green
A green disclaimer
Details
A grey disclaimer
Magenta
A magenta disclaimer
Orange
A orange disclaimer
Red
A red disclaimer

By Special Color

​
> [!default] Default
> Just some default color.
{icon="skull-crossbones"}

> [!transparent] Transparent
> No visible borders.
{icon="skull-crossbones"}

> [!code] Code
> Colored like a code fence.
{icon="skull-crossbones"}

> [!link] Link
> Style of topbar buttons
{icon="skull-crossbones"}

> [!action] Action
> Style of action buttons like Mermaid zoom or block code copy-to-clipboard
{icon="skull-crossbones"}

> [!inline] Inline
> Style of inline buttons like inline code copy-to-clipboard
{icon="skull-crossbones"}
{{% callout icon="skull-crossbones" style="default" title="Default" %}}
Just some default color.
{{% /callout %}}

{{% callout icon="skull-crossbones" style="transparent" title="Transparent" %}}
No visible borders.
{{% /callout %}}

{{% callout icon="skull-crossbones" style="code" title="Code" %}}
Colored like a code fence.
{{% /callout %}}

{{% callout icon="skull-crossbones" style="link" title="Link" %}}
Style of topbar buttons
{{% /callout %}}

{{% callout icon="skull-crossbones" style="action" title="Action" %}}
Style of action buttons like Mermaid zoom or block code copy-to-clipboard
{{% /callout %}}

{{% callout icon="skull-crossbones" style="inline" title="Inline" %}}
Style of inline buttons like inline code copy-to-clipboard
{{% /callout %}}
{{% callout "default" "Default" "skull-crossbones" %}}
Just some default color.
{{% /callout %}}

{{% callout "transparent" "Transparent" "skull-crossbones" %}}
No visible borders.
{{% /callout %}}

{{% callout "code" "Code" "skull-crossbones" %}}
Colored like a code fence.
{{% /callout %}}

{{% callout "link" "Link" "skull-crossbones" %}}
Style of topbar buttons
{{% /callout %}}

{{% callout "action" "Action" "skull-crossbones" %}}
Style of action buttons like Mermaid zoom or block code copy-to-clipboard
{{% /callout %}}

{{% callout "inline" "Inline" "skull-crossbones" %}}
Style of inline buttons like inline code copy-to-clipboard
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Just some default color."
  "icon" "skull-crossbones"
  "style" "default"
  "title" "Default"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "No visible borders."
  "icon" "skull-crossbones"
  "style" "transparent"
  "title" "Transparent"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Colored like a code fence."
  "icon" "skull-crossbones"
  "style" "code"
  "title" "Code"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Style of topbar buttons"
  "icon" "skull-crossbones"
  "style" "link"
  "title" "Link"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Style of action buttons like Mermaid zoom or block code copy-to-clipboard"
  "icon" "skull-crossbones"
  "style" "action"
  "title" "Action"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Style of inline buttons like inline code copy-to-clipboard"
  "icon" "skull-crossbones"
  "style" "inline"
  "title" "Inline"
)}}
Default
Just some default color.
Transparent
No visible borders.
Code
Colored like a code fence.
Action
Style of action buttons like Mermaid zoom or block code copy-to-clipboard
Inline
Style of inline buttons like inline code copy-to-clipboard

Various Features

With User-Defined Color, Font Awesome Brand Icon and Markdown in Title and Content

​
> [!default] **Hugo** is _awesome_
> {{% include "shortcodes/include/INCLUDE_ME.md" %}}
{color="fuchsia" icon="fa-fw fab fa-hackerrank"}
{{% callout color="fuchsia" icon="fa-fw fab fa-hackerrank" title="**Hugo** is _awesome_" %}}
{{% include "shortcodes/include/INCLUDE_ME.md" %}}
{{% /callout %}}
{{% callout %}}
{{% include "shortcodes/include/INCLUDE_ME.md" %}}
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "color" "fuchsia"
  "content" "{{% include \"shortcodes/include/INCLUDE_ME.md\" %}}"
  "icon" "fa-fw fab fa-hackerrank"
  "title" "**Hugo** is _awesome_"
)}}
Hugo is awesome

You can add standard markdown syntax:

  • multiple paragraphs
  • bullet point lists
  • emphasized, bold and even bold emphasized text
  • links
  • etc.1
...and even source code

the possibilities are endless (almost - including other shortcodes may or may not work) (almost - including other shortcodes may or may not work)


  1. Et Cetera (English: /ɛtˈsɛtərə/), abbreviated to etc., etc, et cet., is a Latin expression that is used in English to mean “and other similar things”, or “and so forth” ↩︎

Expandable Content Area with groupid

If you give multiple expandable boxes the same groupid, at most one will be open at any given time. If you open one of the boxes, all other boxes of the same group will close.

​
> [!green]+ Expand me...
> No need to press you!
{groupid="callout-toggle"}

> [!red]- Expand me...
> Thank you!
{groupid="callout-toggle"}
{{% callout expanded="true" groupid="callout-toggle" style="green" title="Expand me..." %}}
No need to press you!
{{% /callout %}}

{{% callout expanded="false" groupid="callout-toggle" style="red" title="Expand me..." %}}
Thank you!
{{% /callout %}}
{{% callout "green" "Expand me..." %}}
No need to press you!
{{% /callout %}}

{{% callout "red" "Expand me..." %}}
Thank you!
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "No need to press you!"
  "expanded" "true"
  "groupid" "callout-toggle"
  "style" "green"
  "title" "Expand me..."
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Thank you!"
  "expanded" "false"
  "groupid" "callout-toggle"
  "style" "red"
  "title" "Expand me..."
)}}
Expand me…
No need to press you!
Expand me…
Thank you!

With Hint

Mouse-over the title of the box to see the hint.

​
> [!tip]
> Built with Hugo.
{hint="Hugo is a static site generator"}
{{% callout hint="Hugo is a static site generator" style="tip" %}}
Built with Hugo.
{{% /callout %}}
{{% callout "tip" %}}
Built with Hugo.
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Built with Hugo."
  "hint" "Hugo is a static site generator"
  "style" "tip"
)}}
Tip
Built with Hugo.

No Content or No Title

​
> [!accent] Just a bar

> [!accent]
> Just a box
{{% callout style="accent" title="Just a bar" %}}{{% /callout %}}

{{% callout style="accent" %}}
Just a box
{{% /callout %}}
{{% callout "accent" "Just a bar" %}}{{% /callout %}}

{{% callout "accent" %}}
Just a box
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "style" "accent"
  "title" "Just a bar"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Just a box"
  "style" "accent"
)}}
Just a bar
Details
Just a box

Various Markdown Callouts

​
> [!caution] Callouts can have custom titles
> Like this one.

> [!caution] Title-only callout

> [!note]- Are callouts foldable?
> Yes! In a foldable callout, the contents are hidden when the callout is collapsed

> [!note]+ Are callouts foldable?
> Yes! In a foldable callout, the contents are hidden when the callout is collapsed

> [!info] Can callouts be nested?
> > [!important] Yes!, they can.
> > > [!tip] You can even use multiple layers of nesting.
{{% callout style="caution" title="Callouts can have custom titles" %}}
Like this one.
{{% /callout %}}

{{% callout style="caution" title="Title-only callout" %}}{{% /callout %}}

{{% callout expanded="false" style="note" title="Are callouts foldable?" %}}
Yes! In a foldable callout, the contents are hidden when the callout is collapsed
{{% /callout %}}

{{% callout expanded="true" style="note" title="Are callouts foldable?" %}}
Yes! In a foldable callout, the contents are hidden when the callout is collapsed
{{% /callout %}}

{{% callout style="info" title="Can callouts be nested?" %}}
> [!important] Yes!, they can.
> > [!tip] You can even use multiple layers of nesting.
{{% /callout %}}
{{% callout "caution" "Callouts can have custom titles" %}}
Like this one.
{{% /callout %}}

{{% callout "caution" "Title-only callout" %}}{{% /callout %}}

{{% callout "note" "Are callouts foldable?" %}}
Yes! In a foldable callout, the contents are hidden when the callout is collapsed
{{% /callout %}}

{{% callout "note" "Are callouts foldable?" %}}
Yes! In a foldable callout, the contents are hidden when the callout is collapsed
{{% /callout %}}

{{% callout "info" "Can callouts be nested?" %}}
> [!important] Yes!, they can.
> > [!tip] You can even use multiple layers of nesting.
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Like this one."
  "style" "caution"
  "title" "Callouts can have custom titles"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "style" "caution"
  "title" "Title-only callout"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Yes! In a foldable callout, the contents are hidden when the callout is collapsed"
  "expanded" "false"
  "style" "note"
  "title" "Are callouts foldable?"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "Yes! In a foldable callout, the contents are hidden when the callout is collapsed"
  "expanded" "true"
  "style" "note"
  "title" "Are callouts foldable?"
)}}

{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "> [!important] Yes!, they can.\n> > [!tip] You can even use multiple layers of nesting."
  "style" "info"
  "title" "Can callouts be nested?"
)}}
Callouts can have custom titles
Like this one.
Title-only callout
Are callouts foldable?
Yes! In a foldable callout, the contents are hidden when the callout is collapsed
Are callouts foldable?
Yes! In a foldable callout, the contents are hidden when the callout is collapsed
Can callouts be nested?
Yes!, they can.
You can even use multiple layers of nesting.

Code with Collapsed Colored Borders

​
> [!secondary]
> ```
> printf("Hello World!");
> ```
{{% callout style="secondary" %}}
```
printf("Hello World!");
```
{{% /callout %}}
{{% callout "secondary" %}}
```
printf("Hello World!");
```
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "```\nprintf(\"Hello World!\");\n```"
  "style" "secondary"
)}}
Details
printf("Hello World!");

User-defined Style

Self-defined styles can be configured in your hugo.toml and used for every shortcode, that accepts a style parameter.

hugo.
[params]
  [[params.boxStyle]]
    color = 'violet'
    i18n = ''
    icon = 'hand-sparkles'
    identifier = 'magic'
    title = 'Magic'
params:
  boxStyle:
  - color: violet
    i18n: ''
    icon: hand-sparkles
    identifier: magic
    title: Magic
{
   "params": {
      "boxStyle": [
         {
            "color": "violet",
            "i18n": "",
            "icon": "hand-sparkles",
            "identifier": "magic",
            "title": "Magic"
         }
      ]
   }
}
​
> [!magic]
> It's a kind of...
> 
> Maaagic!
{{% callout style="magic" %}}
It's a kind of...

Maaagic!
{{% /callout %}}
{{% callout "magic" %}}
It's a kind of...

Maaagic!
{{% /callout %}}
{{ partial "shortcodes/callout.html" (dict
  "page" .
  "content" "It's a kind of...\n\nMaaagic!"
  "style" "magic"
)}}
Magic

It’s a kind of…

Maaagic!

Cards

The cards shortcode displays your content in a grouped set of cards.

  • Terminal Example

    For guys who like to tinker around.

    echo "Hello World!"
  • C Example

    For the connoisseur of programming.

    printf("Hello World!");

Usage

​
{{< cards >}}
{{% card href="https://example.com" title="Python Example" %}}
The AI native programming language.

```python
print("Hello World!")
```
{{% /card %}}
{{% card title="Terminal Example" %}}
For guys who like to tinker around.

```bash
echo "Hello World!"
```
{{% /card %}}
{{% card title="C Example" %}}
For the connoisseur of programming.

```c
printf("Hello World!");
```
{{% /card %}}
{{< /cards >}}
{{ partial "shortcodes/cards.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "The AI native programming language.\n\n```python\nprint(\"Hello World!\")\n```"
      "href" "https://example.com"
      "title" "Python Example"
    )
    (dict
      "content" "For guys who like to tinker around.\n\n```bash\necho \"Hello World!\"\n```"
      "title" "Terminal Example"
    )
    (dict
      "content" "For the connoisseur of programming.\n\n```c\nprintf(\"Hello World!\");\n```"
      "title" "C Example"
    )
  )
)}}

Parameters

Name Default Notes
columns 3 The number of columns in full width mode to display the cards in. Accepts values from 1 to 5. Numbers are reduced when width gets smaller.
template default The template to be used to display all cards in the set. Can be overridden for each card.

- default: The standard layout
- debug: A debug layout helping you in development

See below how to use your own templates.
<content> <empty> Arbitrary number of cards defined with the card sub-shortcode.

Card Parameters

Each card of the set is defined with the card shortcode.

Name Default Notes
href <empty> Either the destination URL for the card or JavaScript code to be executed on click. If this parameter is set, the card will hover on mouse over.

- if starting with javascript: all following text will be executed in your browser
- every other string will be interpreted as URL, you can use link effects as well.
action <empty> Name of an action executed by your own script on click, without inline JavaScript. Use this instead of a JavaScript href if your site uses a strict Content Security Policy. If this parameter is set, the card will hover on mouse over. See example.
image <empty> URL to an image to be displayed at the start of the card.
imagealt <empty> Text alternative for the image, announced by a screen reader in place of the image.

Set it if the card shows nothing but its image, as the image is then the only thing left to name the card. Without it such a card falls back to the title of the page its href leads to, or to the href itself.

Leave it empty if the card also shows a title. The title names the card, so the image beside it is marked as decorative with an empty alt attribute.
title <empty> Arbitrary title for the card.
template default The template to be used to display the card. Overrides the template of the set.

- default: The standard layout
- debug: A debug layout helping you in development

See below how to use your own templates.
params <empty> Arbitrary additional parameter for your template as string (JSON, TOML, YAML) or in a dict.

See example below.
<content> <empty> Arbitrary text to be displayed on the card.

Single Card

If you just want a single card, you can call the card shortcode standalone, without the enclosing cards shortcode.

​
{{% card href="https://example.com" title="High performance code" %}}
Awesome AI accelerated code

```c
printf("Hello World!");
```
{{% /card %}}
{{ partial "shortcodes/card.html" (dict
  "page" .
  "content" "Awesome AI accelerated code\n\n```c\nprintf(\"Hello World!\");\n```"
  "href" "https://example.com"
  "title" "High performance code"
)}}

Card Templates

If you have advanced requirements to display your cards, you can place a card layout partial into layouts/partials/card that will be used for each single card.

For example, if you want to see debug output displaying the parameter the partial receives, you could set template=debug which will cause the partial layouts/partials/cards/debug.html to be called. The debug card template is shipped with the theme.

A card template will be called with all the card parameters. href and image are transformed into a form ready to be consumed.

Examples

Lots of Cards

If only an image is displayed, the full card will be used. As no title is left to name the card, describe the image with the imagealt parameter.

​
{{< cards >}}
{{% card href="/images/magic.gif?download" image="/images/magic.gif" title="Everything" %}}
Image, title, text and href.

You can also use image effects in your `href`. This card will download the image.
{{% /card %}}
{{% card title="Title and Text" %}}Just a title and a text. You can use any **Markdown** in the text{{% /card %}}
{{% card title="Title Only" %}}{{% /card %}}
{{% card image="/images/magic.gif" title="Image and Title" %}}{{% /card %}}
{{% card image="/images/magic.gif" %}}Image and a text{{% /card %}}
{{% card %}}
Text only

```c
printf("Hello Code!");
```
{{% /card %}}
{{% card href="/images/magic.gif?download" image="/images/magic.gif" imagealt="A top hat with a rabbit peeking out" %}}{{% /card %}}
{{< /cards >}}
{{ partial "shortcodes/cards.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "Image, title, text and href.\n\nYou can also use image effects in your `href`. This card will download the image."
      "href" "/images/magic.gif?download"
      "image" "/images/magic.gif"
      "title" "Everything"
    )
    (dict
      "content" "Just a title and a text. You can use any **Markdown** in the text"
      "title" "Title and Text"
    )
    (dict
      "content" ""
      "title" "Title Only"
    )
    (dict
      "content" ""
      "image" "/images/magic.gif"
      "title" "Image and Title"
    )
    (dict
      "content" "Image and a text"
      "image" "/images/magic.gif"
    )
    (dict
      "content" "Text only\n\n```c\nprintf(\"Hello Code!\");\n```"
    )
    (dict
      "content" ""
      "href" "/images/magic.gif?download"
      "image" "/images/magic.gif"
      "imagealt" "A top hat with a rabbit peeking out"
    )
  )
)}}
  • Image, title, text and href.

    You can also use image effects in your href. This card will download the image.

  • Title and Text
    Just a title and a text. You can use any Markdown in the text
  • Title Only
  • Image and Title
  • Image and a text
  • Text only

    printf("Hello Code!");

Lots of Cards with Templates

The debug card template shows all parameter it receives.

The C card adds additional params for the template.

​
{{< cards template="debug" >}}
{{% card params="{"blub":"bla"}" title="C" %}}For the connoisseur of programming.{{% /card %}}
{{% card title="C++" %}}For the guys that can cope with syntax.{{% /card %}}
{{% card title="C#" %}}For guys that need two destructors.{{% /card %}}
{{< /cards >}}
{{ partial "shortcodes/cards.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "For the connoisseur of programming."
      "params" "{\"blub\":\"bla\"}"
      "title" "C"
    )
    (dict
      "content" "For the guys that can cope with syntax."
      "title" "C++"
    )
    (dict
      "content" "For guys that need two destructors."
      "title" "C#"
    )
  )
  "template" "debug"
)}}
  • C

    All Parameter

    {
      "action": "",
      "color": "",
      "content": "For the connoisseur of programming.",
      "href": "",
      "hrefattributes": {},
      "icon": "",
      "image": null,
      "imagealt": "",
      "imageattributes": {},
      "onclick": "",
      "page": "/shortcodes/cards",
      "params": {
        "blub": "bla"
      },
      "style": "filled",
      "template": "debug",
      "title": "C"
    }
  • C++

    All Parameter

    {
      "action": "",
      "color": "",
      "content": "For the guys that can cope with syntax.",
      "href": "",
      "hrefattributes": {},
      "icon": "",
      "image": null,
      "imagealt": "",
      "imageattributes": {},
      "onclick": "",
      "page": "/shortcodes/cards",
      "params": null,
      "style": "filled",
      "template": "debug",
      "title": "C++"
    }
  • C#

    All Parameter

    {
      "action": "",
      "color": "",
      "content": "For guys that need two destructors.",
      "href": "",
      "hrefattributes": {},
      "icon": "",
      "image": null,
      "imagealt": "",
      "imageattributes": {},
      "onclick": "",
      "page": "/shortcodes/cards",
      "params": null,
      "style": "filled",
      "template": "debug",
      "title": "C#"
    }

Card with Own Action

The card is written with a data-button-action attribute. Handle it in your assets/js/custom.js, which the theme loads on every page.

​
{{% card action="shout" title="Shout it out" %}}Click to greet the world{{% /card %}}
{{ partial "shortcodes/card.html" (dict
  "page" .
  "action" "shout"
  "content" "Click to greet the world"
  "title" "Shout it out"
)}}
​
document.addEventListener('click', function (event) {
  var button = event.target.closest('button[data-button-action="shout"]');
  if (button) {
    alert('Hello world!');
    button.blur();
  }
});

Details

The details shortcode displays an expandable/collapsible section of text.

Expand me…

Thank you!

Usage

​
> [!details]- Expand me...
> Thank you!
{{< details summary="Expand me..." >}}
Thank you!
{{< /details >}}
{{ partial "shortcodes/details.html" (dict
  "page" .
  "content" "Thank you!"
  "summary" "Expand me..."
)}}

This shortcode is fully compatible with Hugo’s details shortcode but offers some extensions.

Markdown callout syntax is available in other Markdown parsers like Obsidian and therefore is the recommended syntax for generating portable Markdown.

In Markdown syntax the section is a callout of the style details. Its first line takes summary and open, while name and title are written as the Markdown attributes groupid and hint. class and raw are not available.

The callout shortcode is also capable of displaying expandable/collapsible sections of text but with additional parameters for color and additional icons.

Parameters

Name Default Notes
summary "Details" Arbitrary text to appear next to the expand/collapse icon.
open false How the content is displayed.

- true: the content is initially shown
- false: the content is initially hidden
name <empty> Arbitrary name of the group the section belongs to.

Of all sections with the same name, at most one is open at any given time.
class <empty> CSS classes to be added to the section.
title <empty> Arbitrary text to be displayed as a tooltip for the summary.
raw false Extension. How the content is processed.

- false: the content is rendered as Markdown
- true: the content is written as it is, see below
<content> <empty> Arbitrary text to be displayed on expand.

Examples

All Defaults

​
> [!details]- Details
> Yes, you did it!
{{< details >}}
Yes, you did it!
{{< /details >}}
{{ partial "shortcodes/details.html" (dict
  "page" .
  "content" "Yes, you did it!"
)}}
Details

Yes, you did it!

Initially Expanded

​
> [!details]+ Expand me...
> No need to press you!
{{< details open="true" summary="Expand me..." >}}
No need to press you!
{{< /details >}}
{{ partial "shortcodes/details.html" (dict
  "page" .
  "content" "No need to press you!"
  "open" "true"
  "summary" "Expand me..."
)}}
Expand me…

No need to press you!

Arbitrary Text

​
> [!details]- Show me almost **endless** possibilities
> You can add standard markdown syntax:
> 
> - multiple paragraphs
> - bullet point lists
> - _emphasized_, **bold** and even **_bold emphasized_** text
> - [links](https://example.com)
> - etc.
> 
> ```plaintext
> ...and even source code
> ```
> 
> > the possibilities are endless (almost - including other shortcodes may or may not work)
{{< details summary="Show me almost **endless** possibilities" >}}
You can add standard markdown syntax:

- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- etc.

```plaintext
...and even source code
```

> the possibilities are endless (almost - including other shortcodes may or may not work)
{{< /details >}}
{{ partial "shortcodes/details.html" (dict
  "page" .
  "content" "You can add standard markdown syntax:\n\n- multiple paragraphs\n- bullet point lists\n- _emphasized_, **bold** and even **_bold emphasized_** text\n- [links](https://example.com)\n- etc.\n\n```plaintext\n...and even source code\n```\n\n> the possibilities are endless (almost - including other shortcodes may or may not work)"
  "summary" "Show me almost **endless** possibilities"
)}}
Show me almost endless possibilities

You can add standard markdown syntax:

  • multiple paragraphs
  • bullet point lists
  • emphasized, bold and even bold emphasized text
  • links
  • etc.
...and even source code

the possibilities are endless (almost - including other shortcodes may or may not work)

Grouped Sections

If you give multiple sections the same name, they behave like an accordion: at most one will be open at any given time. If you open one of the sections, all other sections of the same group will close.

​
> [!details]+ Expand me...
> No need to press you!
{groupid="details-toggle"}

> [!details]- Expand me...
> Thank you!
{groupid="details-toggle"}
{{< details name="details-toggle" open="true" summary="Expand me..." >}}
No need to press you!
{{< /details >}}

{{< details name="details-toggle" summary="Expand me..." >}}
Thank you!
{{< /details >}}
{{ partial "shortcodes/details.html" (dict
  "page" .
  "content" "No need to press you!"
  "name" "details-toggle"
  "open" "true"
  "summary" "Expand me..."
)}}

{{ partial "shortcodes/details.html" (dict
  "page" .
  "content" "Thank you!"
  "name" "details-toggle"
  "summary" "Expand me..."
)}}
Expand me…

No need to press you!

Expand me…

Thank you!

Raw Content

The content is rendered as Markdown on its own, apart from the rest of your page. This has consequences:

  • A footnote defined inside of the content is listed inside of the section instead of at the end of your page, and a footnote defined outside of it can not be referenced.
  • A heading inside of the content doesn’t show up in the table of contents.
  • With goldmark.renderer.unsafe=false (which is the default if you don’t set it), HTML inside of the content is removed. This includes the HTML written by other shortcodes you call in there.

If the content is HTML already or contains other shortcodes, set raw=true. The content is then written as it is and no Markdown is rendered.

{{< details summary="Expand me..." raw=true >}}
<p>A badge inside of a paragraph: {{% badge style="primary" %}}Important{{% /badge %}}</p>
{{< /details >}}
Expand me…

A badge inside of a paragraph: Important

Calling Syntax

Call the shortcode with {{< details >}} as shown on this page. This works regardless of your configuration.

A call with {{% details %}} writes its HTML into the Markdown of your page. With goldmark.renderer.unsafe=false the whole section is removed.

Highlight

The highlight shortcode renders your code with a syntax highlighter.

​
1print("Hello World!")

Usage

​
```py {lineNos="true" title="python" wrap="true"}
print("Hello World!")
```
{{< highlight lineNos="true" title="python" type="py" wrap="true" >}}
print("Hello World!")
{{< /highlight >}}
{{< highlight "py" "lineNos=true,title=python,wrap=true" >}}
print("Hello World!")
{{< /highlight >}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "print(\"Hello World!\")"
  "lineNos" "true"
  "title" "python"
  "type" "py"
  "wrap" "true"
)}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "print(\"Hello World!\")"
  "type" "py"
  "options" "lineNos=true,title=python,wrap=true"
)}}

This shortcode is fully compatible with Hugo’s highlight shortcode but offers some extensions.

It is called interchangeably in the same way as Hugo’s own shortcode by providing positional parameters or simply by using Markdown codefences.

You are free to also call this shortcode from your own partials. In this case it resembles Hugo’s highlight function syntax if you call it using compatibility syntax.

Markdown codefence syntax is widely available in other Markdown parsers like GitHub and therefore is the recommended syntax for generating portable Markdown.

The tab shortcode is also capable of displaying code but with limited options.

Parameters

Name Position Default Notes
type 1 <empty> The language of the code to highlight. Choose from one of the supported languages. Case-insensitive.
title <empty> Extension. Arbitrary title for code. This displays the code like a single tab if hl_inline=false (which is Hugo’s default).
wrap see notes Extension. When true the content may wrap on long lines otherwise it will be scrollable.

The default value can be set in your hugo.toml and overwritten via front matter. See below.
options 2 <empty> An optional, comma-separated list of zero or more Hugo supported options as well as extension parameter from this table.
<option> <empty> Any of Hugo’s supported options.
<content> <empty> Your code to highlight.

Settings

Setting Default Values for Hugo’s Options

Default values for Hugo’s supported options can be set via goldmark settings.

If used together with wrapping of long lines, use this recommended settings. Otherwise, line numbers will shift if code wraps.

hugo.
[markup]
  [markup.highlight]
    lineNumbersInTable = false
markup:
  highlight:
    lineNumbersInTable: false
{
   "markup": {
      "highlight": {
         "lineNumbersInTable": false
      }
   }
}

Setting Wrap of Long Lines

Option Front Matter By default, code will be wrapped if the line is not long enough.

You can disable wrapping by setting highlightWrap=false or by setting the wrap parameter individually for each code block.

​
[params]
  highlightWrap = false
params:
  highlightWrap: false
{
   "params": {
      "highlightWrap": false
   }
}

Copy to Clipboard for Inline Code

Option By default inline code has a button to copy the code to the clipboard.

If you want to disable this feature, set disableInlineCopyToClipBoard=true.

hugo.
[params]
  disableInlineCopyToClipBoard = true
params:
  disableInlineCopyToClipBoard: true
{
   "params": {
      "disableInlineCopyToClipBoard": true
   }
}

Copy to Clipboard for Block Code

Option By default block code has a button to copy the code to the clipboard that is only visible on hover.

Set disableHoverBlockCopyToClipBoard=true to disable the hover effect and always show the button.

hugo.
[params]
  disableHoverBlockCopyToClipBoard = true
params:
  disableHoverBlockCopyToClipBoard: true
{
   "params": {
      "disableHoverBlockCopyToClipBoard": true
   }
}

Setting a Specific Color Scheme

You can configure the color style used for code blocks in your color variants stylesheet file using the --CODE-theme variable. This requires further configuration as described in the above link.

Examples

Line Numbers with Starting Offset

As mentioned above, line numbers in a table layout will shift if code is wrapping, so better use inline. To make things easier for you, set lineNumbersInTable = false in your hugo.toml and add lineNos = true when calling the shortcode instead of the specific values table or inline.

​
```py {lineNoStart="666" lineNos="true"}
# the hardest part is to start writing code; here's a kickstart; just copy and paste this; it's free; the next lines will cost you serious credits
print("Hello")
print(" ")
print("World")
print("!")
```
{{< highlight lineNoStart="666" lineNos="true" type="py" >}}
# the hardest part is to start writing code; here's a kickstart; just copy and paste this; it's free; the next lines will cost you serious credits
print("Hello")
print(" ")
print("World")
print("!")
{{< /highlight >}}
{{< highlight "py" "lineNoStart=666,lineNos=true" >}}
# the hardest part is to start writing code; here's a kickstart; just copy and paste this; it's free; the next lines will cost you serious credits
print("Hello")
print(" ")
print("World")
print("!")
{{< /highlight >}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "# the hardest part is to start writing code; here's a kickstart; just copy and paste this; it's free; the next lines will cost you serious credits\nprint(\"Hello\")\nprint(\" \")\nprint(\"World\")\nprint(\"!\")"
  "lineNoStart" "666"
  "lineNos" "true"
  "type" "py"
)}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "# the hardest part is to start writing code; here's a kickstart; just copy and paste this; it's free; the next lines will cost you serious credits\nprint(\"Hello\")\nprint(\" \")\nprint(\"World\")\nprint(\"!\")"
  "type" "py"
  "options" "lineNoStart=666,lineNos=true"
)}}
666# the hardest part is to start writing code; here's a kickstart; just copy and paste this; it's free; the next lines will cost you serious credits
667print("Hello")
668print(" ")
669print("World")
670print("!")

With Title

​
```py {title="python"}
# a bit shorter
print("Hello World!")
```
{{< highlight title="python" type="py" >}}
# a bit shorter
print("Hello World!")
{{< /highlight >}}
{{< highlight "py" "title=python" >}}
# a bit shorter
print("Hello World!")
{{< /highlight >}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "# a bit shorter\nprint(\"Hello World!\")"
  "title" "python"
  "type" "py"
)}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "# a bit shorter\nprint(\"Hello World!\")"
  "type" "py"
  "options" "title=python"
)}}
​
# a bit shorter
print("Hello World!")

With Wrap

​
```py {hl_lines="2" wrap="true"}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
# Some more stuff
```
{{< highlight hl_lines="2" type="py" wrap="true" >}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
# Some more stuff
{{< /highlight >}}
{{< highlight "py" "hl_lines=2,wrap=true" >}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
# Some more stuff
{{< /highlight >}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "# Quicksort Python One-liner\nlambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])\n# Some more stuff"
  "hl_lines" "2"
  "type" "py"
  "wrap" "true"
)}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "# Quicksort Python One-liner\nlambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])\n# Some more stuff"
  "type" "py"
  "options" "hl_lines=2,wrap=true"
)}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
# Some more stuff

Without Wrap

​
```py {hl_lines="2" wrap="false"}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
# Some more stuff
```
{{< highlight hl_lines="2" type="py" wrap="false" >}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
# Some more stuff
{{< /highlight >}}
{{< highlight "py" "hl_lines=2,wrap=false" >}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
# Some more stuff
{{< /highlight >}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "# Quicksort Python One-liner\nlambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])\n# Some more stuff"
  "hl_lines" "2"
  "type" "py"
  "wrap" "false"
)}}
{{ partial "shortcodes/highlight.html" (dict
  "page" .
  "content" "# Quicksort Python One-liner\nlambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])\n# Some more stuff"
  "type" "py"
  "options" "hl_lines=2,wrap=false"
)}}
# Quicksort Python One-liner
lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
# Some more stuff

Icon

The icon shortcode displays icons using the Font Awesome library.

Usage

​
{{% icon icon="heart" %}}
{{% icon icon="skull-crossbones" style="blue" %}}
{{% icon style="warning" %}}
{{% icon color="blue" icon="angle-double-up" %}}
{{% icon "heart" %}}
{{% icon "skull-crossbones" "blue" %}}
{{% icon %}}
{{% icon "angle-double-up" %}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "heart"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "skull-crossbones"
  "style" "blue"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "style" "warning"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "color" "blue"
  "icon" "angle-double-up"
)}}

Parameters

Name Position Default Notes
icon 1 <empty> Font Awesome icon name to be displayed. It will be displayed in the text color of its according context.
style 2 <empty> The style scheme used for the icon.

- by severity: caution, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code, link, action, inline

You can also define your own styles.
color <empty> The CSS color value to be used. If not set, the chosen color depends on the style. Any given value will overwrite the default.

- for severity styles: a nice matching color for the severity
- for all other styles: the corresponding color

Finding an icon

Browse through the available icons in the Font Awesome Gallery. Notice that the free filter is enabled, as only the free icons are available by default.

Once on the Font Awesome page for a specific icon, for example the page for the heart, copy the icon name and paste into the Markdown content.

Customizing Icons

Font Awesome provides many ways to modify the icon

  • Change color (by default the icon will inherit the parent color)
  • Increase or decrease size
  • Rotate
  • Combine with other icons

Check the full documentation on web fonts with CSS for more.

Examples

Standard Usage

​
Built with {{% icon icon="heart" %}} by Relearn and Hugo
Built with {{% icon "heart" %}} by Relearn and Hugo
Built with {{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "heart"
)}} by Relearn and Hugo
Built with by Relearn and Hugo

With Color

​
Built with {{% icon icon="heart" style="red" %}} by Relearn and Hugo
Built with {{% icon "heart" "red" %}} by Relearn and Hugo
Built with {{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "heart"
  "style" "red"
)}} by Relearn and Hugo
Built with by Relearn and Hugo

Advanced HTML Usage

While the shortcode simplifies using standard icons, the icon customization and other advanced features of the Font Awesome library require you to use HTML directly. Paste the <i> HTML into markup, and Font Awesome will load the relevant icon.

Built with <i class="fas fa-heart"></i> by Relearn and Hugo

Built with by Relearn and Hugo

To use these native HTML elements in your Markdown, add this in your hugo.toml:

hugo.
[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true
markup:
  goldmark:
    renderer:
      unsafe: true
{
   "markup": {
      "goldmark": {
         "renderer": {
            "unsafe": true
         }
      }
   }
}

Style

By Severity

​
{{% icon style="caution" %}}
{{% icon style="important" %}}
{{% icon style="info" %}}
{{% icon style="note" %}}
{{% icon style="tip" %}}
{{% icon style="warning" %}}
{{% icon %}}
{{% icon %}}
{{% icon %}}
{{% icon %}}
{{% icon %}}
{{% icon %}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "style" "caution"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "style" "important"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "style" "info"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "style" "note"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "style" "tip"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "style" "warning"
)}}

By Brand Colors

​
{{% icon icon="bullhorn" style="primary" %}}
{{% icon icon="bullhorn" style="secondary" %}}
{{% icon icon="bullhorn" style="accent" %}}
{{% icon "bullhorn" "primary" %}}
{{% icon "bullhorn" "secondary" %}}
{{% icon "bullhorn" "accent" %}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "bullhorn"
  "style" "primary"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "bullhorn"
  "style" "secondary"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "bullhorn"
  "style" "accent"
)}}

By Color

​
{{% icon icon="palette" style="blue" %}}
{{% icon icon="palette" style="cyan" %}}
{{% icon icon="palette" style="green" %}}
{{% icon icon="palette" style="grey" %}}
{{% icon icon="palette" style="magenta" %}}
{{% icon icon="palette" style="orange" %}}
{{% icon icon="palette" style="red" %}}
{{% icon "palette" "blue" %}}
{{% icon "palette" "cyan" %}}
{{% icon "palette" "green" %}}
{{% icon "palette" "grey" %}}
{{% icon "palette" "magenta" %}}
{{% icon "palette" "orange" %}}
{{% icon "palette" "red" %}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "blue"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "cyan"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "green"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "grey"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "magenta"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "orange"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "red"
)}}

By Special Color

​
{{% icon icon="palette" style="default" %}}
{{% icon icon="palette" style="transparent" %}}
{{% icon icon="palette" style="code" %}}
{{% icon icon="palette" style="link" %}}
{{% icon icon="palette" style="action" %}}
{{% icon icon="palette" style="inline" %}}
{{% icon "palette" "default" %}}
{{% icon "palette" "transparent" %}}
{{% icon "palette" "code" %}}
{{% icon "palette" "link" %}}
{{% icon "palette" "action" %}}
{{% icon "palette" "inline" %}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "default"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "transparent"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "code"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "link"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "action"
)}}
{{ partial "shortcodes/icon.html" (dict
  "page" .
  "icon" "palette"
  "style" "inline"
)}}

Include

The include shortcode includes other pages, resources or files from your project.

Hello Hugo!

Usage

​
{{% include file="shortcodes/include/INCLUDE_GREETINGS.md" %}}
{{% include "shortcodes/include/INCLUDE_GREETINGS.md" %}}
{{ partial "shortcodes/include.html" (dict
  "page" .
  "file" "shortcodes/include/INCLUDE_GREETINGS.md"
)}}

The included files can even contain Markdown and will be taken into account when generating the table of contents.

Parameters

Name Position Default Notes
file 1 <empty> The path to the page, resource or file to be included. Page and resource paths adhere to Hugo’s logical path. If not found by logical path it falls back to Hugo’s build-in readFile function
hidefirstheading 2 false When true and the included file contains headings, the first heading will be hidden. This comes in handy, eg. if you include otherwise standalone Markdown files.

Settings

Option Front Matter You can use include.errorlevel to control what should happen if a local link cannot be resolved to a resource.

If not set or empty, any unresolved link is written as given into the resulting output. If set to warning the same happens and an additional warning is printed in the built console. If set to error an error message is printed and the build is aborted.

Please note that this cannot resolve files inside of your static directory. The file must be a resource of the page or the site.

Link warnings are also available for images & links and the openapi shortcode.

​
[params]
  [params.include]
    errorlevel = 'warning'
params:
  include:
    errorlevel: warning
{
   "params": {
      "include": {
         "errorlevel": "warning"
      }
   }
}

Examples

Arbitrary Content

​
{{% include file="shortcodes/include/INCLUDE_ME.md" %}}
{{% include "shortcodes/include/INCLUDE_ME.md" %}}
{{ partial "shortcodes/include.html" (dict
  "page" .
  "file" "shortcodes/include/INCLUDE_ME.md"
)}}

You can add standard markdown syntax:

  • multiple paragraphs
  • bullet point lists
  • emphasized, bold and even bold emphasized text
  • links
  • etc.1
...and even source code

the possibilities are endless (almost - including other shortcodes may or may not work) (almost - including other shortcodes may or may not work)


  1. Et Cetera (English: /ɛtˈsɛtərə/), abbreviated to etc., etc, et cet., is a Latin expression that is used in English to mean “and other similar things”, or “and so forth” ↩︎

Math

The math shortcode renders complex math and chemical formulae using Hugo’s built-in KaTeX.

(∑k=1nakbk)2≤(∑k=1nak2)(∑k=1nbk2)\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

Usage

​
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
```math {align="center"}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
```
{{< math align="center" >}}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
{{< /math >}}
{{ partial "shortcodes/math.html" (dict
  "page" .
  "align" "center"
  "content" "$$\\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right)$$"
)}}

You can also use pure Markdown for writing simple math expressions.

Delimiters around your formulae require the Passthrough configuration, as the theme finds your formulae by them. Passthrough syntax itself has limited features as it does not provide any of the below parameters besides content. Nevertheless, it is widely available in other Markdown parsers like GitHub and therefore is the recommended syntax for generating portable Markdown.

Parameters

Name Default Notes
align center The vertical alignment.

Allowed values are left, center or right.
<content> <empty> Your formulae.

Enclose each formula in the block or inline delimiters of your Passthrough configuration. Text outside of them is written as Markdown.

Without any delimiters, the whole content is one formula displayed as a block.

Settings

Output of the Formulae

Option Front Matter By default, formulae are written as MathML, which every current browser displays without any stylesheet or font of the theme. The display quality depends on the browser and the math fonts installed on your reader’s system.

If you want your formulae to look the same in every browser, set math.output to htmlAndMathml. The theme then links the KaTeX stylesheet and fonts to every page containing math. The MathML is kept for screen readers. The value html omits it.

​
[params]
  [params.math]
    output = 'htmlAndMathml'
params:
  math:
    output: htmlAndMathml
{
   "params": {
      "math": {
         "output": "htmlAndMathml"
      }
   }
}

Providing Options for KaTeX

Option Front Matter Besides output, you can set every option of Hugo’s transform.ToMath function in math, for example your own macros.

Each option of your page’s front matter overwrites the option of the same name of your configuration options.

​
[math]
  [math.macros]
    '\R' = '\mathbb{R}'

[params]
math:
  macros:
    '\R': '\mathbb{R}'
params: {}
{
   "math": {
      "macros": {
         "\\R": "\\mathbb{R}"
      }
   },
   "params": {}
}

A formula that KaTeX can not render is written as its source and reported as a warning in your build.

Force Loading of the KaTeX Stylesheet

Option Front Matter If your output needs the KaTeX stylesheet, it will be linked to your page if the page contains a math shortcode, Markdown codefence, Passthrough syntax or the partial is called from your templates.

If you write KaTeX’s HTML by other means, you can force linking the stylesheet by setting math.force=true. If a formula was rendered, the option has no effect.

math=true does the same but can’t be combined with other math.* options.

​
[params]
  [params.math]
    force = true
params:
  math:
    force: true
{
   "params": {
      "math": {
         "force": true
      }
   }
}

Passthrough Configuration

The theme finds your formulae by the delimiters of Hugo’s Passthrough configuration, so it is required if you use delimiters in any syntax. It also lets you write math without enclosing it in a shortcode or Markdown codefence.

hugo.
[markup]
  [markup.goldmark]
    [markup.goldmark.extensions]
      [markup.goldmark.extensions.passthrough]
        enable = true

        [markup.goldmark.extensions.passthrough.delimiters]
          block = [['\[', '\]'], ['$$', '$$']]
          inline = [['\(', '\)'], ['$', '$']]
markup:
  goldmark:
    extensions:
      passthrough:
        delimiters:
          block:
          - - '\['
            - '\]'
          - - $$
            - $$
          inline:
          - - '\('
            - '\)'
          - - $
            - $
        enable: true
{
   "markup": {
      "goldmark": {
         "extensions": {
            "passthrough": {
               "delimiters": {
                  "block": [
                     [
                        "\\[",
                        "\\]"
                     ],
                     [
                        "$$",
                        "$$"
                     ]
                  ],
                  "inline": [
                     [
                        "\\(",
                        "\\)"
                     ],
                     [
                        "$",
                        "$"
                     ]
                  ]
               },
               "enable": true
            }
         }
      }
   }
}

See the example on how a Passthrough configurations makes using math really easy.

Examples

Block Math

In Passthrough default configuration, block math is generated if you use two consecutive $$ as a delimiter around your formulae.

​
$$\left|
\begin{array}{cc}
a & b \\
c & d
\end{array}\right|$$
```math
$$\left|
\begin{array}{cc}
a & b \\
c & d
\end{array}\right|$$
```
{{< math >}}
$$\left|
\begin{array}{cc}
a & b \\
c & d
\end{array}\right|$$
{{< /math >}}
{{ partial "shortcodes/math.html" (dict
  "page" .
  "content" "$$\\left|\n\\begin{array}{cc}\na & b \\\\\nc & d\n\\end{array}\\right|$$"
)}}
∣abcd∣\left| \begin{array}{cc} a & b \\ c & d \end{array}\right|

Inline Math

In Passthrough default configuration, inline math is generated if you use a single $ as a delimiter around your formulae.

​
Euclid already knew, $\sqrt{2}$ is irrational.
Euclid already knew, {{< math >}}$\sqrt{2}${{< /math >}} is irrational.
Euclid already knew, {{ partial "shortcodes/math.html" (dict
  "page" .
  "content" "$\\sqrt{2}$"
)}} is irrational.
Euclid already knew, 2\sqrt{2} is irrational.

Block Math with Right Alignment

With Passthrough syntax, only the content parameter is available.

​
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
```math {align="right"}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
```
{{< math align="right" >}}
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
{{< /math >}}
{{ partial "shortcodes/math.html" (dict
  "page" .
  "align" "right"
  "content" "$$\\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right)$$"
)}}
(∑k=1nakbk)2≤(∑k=1nak2)(∑k=1nbk2)\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

Chemical Formulae

KaTeX can also render chemical formulae.

​
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
```math
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
```
{{< math >}}
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
{{< /math >}}
{{ partial "shortcodes/math.html" (dict
  "page" .
  "content" "$$\\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$"
)}}
HgX2+→IX−HgIX2→IX−[HgXIIIX4]X2−\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}

Mermaid

The mermaid shortcode generates diagrams and flowcharts from text using the Mermaid library.

graph LR;
  If --> Then
  Then --> Else

Every graph has a button to show it in a lightbox. Press the button again, click beside the graph, press ESC or go back in your browser to return to the page. The enlarged graph has its own URL, so you can share a link to it, like you can for an enlarged image. In the lightbox, a graph is panned and zoomed the same way as on the page.

Usage

​
```mermaid {align="center" zoom="true"}
graph LR;
  If --> Then
  Then --> Else
```
{{< mermaid align="center" zoom="true" >}}
graph LR;
  If --> Then
  Then --> Else
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "align" "center"
  "content" "graph LR;\n  If --> Then\n  Then --> Else"
  "zoom" "true"
)}}

Parameters

Name Default Notes
align center The vertical alignment.

Allowed values are left, center or right.
zoom see notes Whether the graph is pan- and zoomable.

If not set the value is determined by the mermaidZoom setting of your configurations options or the pages front matter or false if not set at all.

- false: no pan or zoom
- true: pan and zoom active
<content> <empty> Your Mermaid graph.

Settings

Configuring Pan and Zoom

Option Front Matter The generated graphs can be panned by dragging them and zoomed by using the mousewheel. On mobile devices you can use finger gestures. With the keyboard, a focused graph is panned by the cursor keys and zoomed by + and -, as listed with the other keyboard shortcuts.

By default this is disabled. Set mermaidZoom=true to enable it.

Individual settings of a graphs zoom parameter have precedence over the page’s front matter and configuration options in that order.

​
[params]
  mermaidZoom = true
params:
  mermaidZoom: true
{
   "params": {
      "mermaidZoom": true
   }
}

Providing Initialization Options for the Mermaid Library

Option Front Matter The Mermaid library is configured with default settings for initialization.

You can overwrite the settings by providing a JSON object in mermaidInitialize. See Mermaid’s documentation for all allowed settings.

Note

Using the theme setting in the initialization options is unsupported. To set the theme globally edit the --MERMAID-theme variable of your color variant.

Keep in mind that initialization settings of your pages front matter overwrite all settings of your configuration options.

In addition, you can merge settings for each individual graph through diagram directives on top of the settings of your page’s front matter or configuration options.

​
[params]
  mermaidInitialize = '{ "securityLevel": "loose" }'
params:
  mermaidInitialize: '{ "securityLevel": "loose" }'
{
   "params": {
      "mermaidInitialize": "{ \"securityLevel\": \"loose\" }"
   }
}

Using a Different Version of the Mermaid Library

The theme uses the shipped Mermaid library by default.

In case you want to use a different version of the Mermaid library, store it as assets/js/mermaid/mermaid.min.js in your site. It replaces the shipped version.

Force Loading of the Mermaid Library

Option Front Matter The Mermaid library will be loaded if the page contains an mermaid shortcode, Markdown codefence or the partial is called from your templates.

You can force loading the Mermaid library if no shortcode, Markdown codefence or partial was called by setting mermaid.force=true. If a shortcode, Markdown codefence or partial was called, this option has no effect. This comes handy in case you are using scripting to render a graph.

​
[params]
  [params.mermaid]
    force = true
params:
  mermaid:
    force: true
{
   "params": {
      "mermaid": {
         "force": true
      }
   }
}

Setting a Specific Mermaid Theme

While you can configure the Mermaid theme to render your graph by using one of the initialization options, the recommended way is to set the default value using the --MERMAID-theme variable in your color variant stylesheet. This allows your graphs to look pretty when the user switches the color variant.

Examples

Flowchart with YAML-Title

​
```mermaid
---
title: Example Diagram
---
graph LR;
  A[Hard edge] -->|Link text| B(Round edge)
  B --> C{<strong>Decision</strong>}
  C -->|One| D[Result one]
  C -->|Two| E[Result two]
```
{{< mermaid >}}
---
title: Example Diagram
---
graph LR;
  A[Hard edge] -->|Link text| B(Round edge)
  B --> C{<strong>Decision</strong>}
  C -->|One| D[Result one]
  C -->|Two| E[Result two]
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "---\ntitle: Example Diagram\n---\ngraph LR;\n  A[Hard edge] -->|Link text| B(Round edge)\n  B --> C{<strong>Decision</strong>}\n  C -->|One| D[Result one]\n  C -->|Two| E[Result two]"
)}}
---
title: Example Diagram
---
graph LR;
  A[Hard edge] -->|Link text| B(Round edge)
  B --> C{<strong>Decision</strong>}
  C -->|One| D[Result one]
  C -->|Two| E[Result two]

Swimlanes

​
```mermaid
swimlane-beta LR
  subgraph Customer
    request[Request service]
    receive[Receive update]
  end

  subgraph Support
    triage[Triage request]
    answer[Send answer]
  end

  subgraph Engineering
    investigate[Investigate issue]
    fix[Prepare fix]
  end

  request --> triage
  triage -->|Known issue| answer
  triage -->|Needs code change| investigate
  investigate --> fix --> answer
  answer --> receive
```
{{< mermaid >}}
swimlane-beta LR
  subgraph Customer
    request[Request service]
    receive[Receive update]
  end

  subgraph Support
    triage[Triage request]
    answer[Send answer]
  end

  subgraph Engineering
    investigate[Investigate issue]
    fix[Prepare fix]
  end

  request --> triage
  triage -->|Known issue| answer
  triage -->|Needs code change| investigate
  investigate --> fix --> answer
  answer --> receive
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "swimlane-beta LR\n  subgraph Customer\n    request[Request service]\n    receive[Receive update]\n  end\n\n  subgraph Support\n    triage[Triage request]\n    answer[Send answer]\n  end\n\n  subgraph Engineering\n    investigate[Investigate issue]\n    fix[Prepare fix]\n  end\n\n  request --> triage\n  triage -->|Known issue| answer\n  triage -->|Needs code change| investigate\n  investigate --> fix --> answer\n  answer --> receive"
)}}
swimlane-beta LR
  subgraph Customer
    request[Request service]
    receive[Receive update]
  end

  subgraph Support
    triage[Triage request]
    answer[Send answer]
  end

  subgraph Engineering
    investigate[Investigate issue]
    fix[Prepare fix]
  end

  request --> triage
  triage -->|Known issue| answer
  triage -->|Needs code change| investigate
  investigate --> fix --> answer
  answer --> receive

Sequence Diagram with Configuration Directive

​
```mermaid
%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Alice->>John: Hello John, how are you?
  loop Healthcheck
      John->>John: Fight against hypochondria
  end
  Note right of John: Rational thoughts!
  John-->>Alice: Great!
  John->>Bob: How about you?
  Bob-->>John: Jolly good!
```
{{< mermaid >}}
%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Alice->>John: Hello John, how are you?
  loop Healthcheck
      John->>John: Fight against hypochondria
  end
  Note right of John: Rational thoughts!
  John-->>Alice: Great!
  John->>Bob: How about you?
  Bob-->>John: Jolly good!
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "%%{init:{\"fontFamily\":\"monospace\", \"sequence\":{\"showSequenceNumbers\":true}}}%%\nsequenceDiagram\n  Alice->>John: Hello John, how are you?\n  loop Healthcheck\n      John->>John: Fight against hypochondria\n  end\n  Note right of John: Rational thoughts!\n  John-->>Alice: Great!\n  John->>Bob: How about you?\n  Bob-->>John: Jolly good!"
)}}
%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Alice->>John: Hello John, how are you?
  loop Healthcheck
      John->>John: Fight against hypochondria
  end
  Note right of John: Rational thoughts!
  John-->>Alice: Great!
  John->>Bob: How about you?
  Bob-->>John: Jolly good!

Class Diagram

​
```mermaid
classDiagram
  Animal <|-- Duck
  Animal <|-- Fish
  Animal <|-- Zebra
  Animal : +int age
  Animal : +String gender
  Animal: +isMammal()
  Animal: +mate()
  class Duck{
    +String beakColor
    +swim()
    +quack()
  }
  class Fish{
    -int sizeInFeet
    -canEat()
  }
  class Zebra{
    +bool is_wild
    +run()
  }
```
{{< mermaid >}}
classDiagram
  Animal <|-- Duck
  Animal <|-- Fish
  Animal <|-- Zebra
  Animal : +int age
  Animal : +String gender
  Animal: +isMammal()
  Animal: +mate()
  class Duck{
    +String beakColor
    +swim()
    +quack()
  }
  class Fish{
    -int sizeInFeet
    -canEat()
  }
  class Zebra{
    +bool is_wild
    +run()
  }
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "classDiagram\n  Animal <|-- Duck\n  Animal <|-- Fish\n  Animal <|-- Zebra\n  Animal : +int age\n  Animal : +String gender\n  Animal: +isMammal()\n  Animal: +mate()\n  class Duck{\n    +String beakColor\n    +swim()\n    +quack()\n  }\n  class Fish{\n    -int sizeInFeet\n    -canEat()\n  }\n  class Zebra{\n    +bool is_wild\n    +run()\n  }"
)}}
classDiagram
  Animal <|-- Duck
  Animal <|-- Fish
  Animal <|-- Zebra
  Animal : +int age
  Animal : +String gender
  Animal: +isMammal()
  Animal: +mate()
  class Duck{
    +String beakColor
    +swim()
    +quack()
  }
  class Fish{
    -int sizeInFeet
    -canEat()
  }
  class Zebra{
    +bool is_wild
    +run()
  }

State Diagram with Right Alignment

​
```mermaid {align="right"}
stateDiagram-v2
  open: Open Door
  closed: Closed Door
  locked: Locked Door
  open   --> closed: Close
  closed --> locked: Lock
  locked --> closed: Unlock
  closed --> open: Open
```
{{< mermaid align="right" >}}
stateDiagram-v2
  open: Open Door
  closed: Closed Door
  locked: Locked Door
  open   --> closed: Close
  closed --> locked: Lock
  locked --> closed: Unlock
  closed --> open: Open
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "align" "right"
  "content" "stateDiagram-v2\n  open: Open Door\n  closed: Closed Door\n  locked: Locked Door\n  open   --> closed: Close\n  closed --> locked: Lock\n  locked --> closed: Unlock\n  closed --> open: Open"
)}}
stateDiagram-v2
  open: Open Door
  closed: Closed Door
  locked: Locked Door
  open   --> closed: Close
  closed --> locked: Lock
  locked --> closed: Unlock
  closed --> open: Open

Entity Relationship Model with Non-Default Mermaid Theme

​
```mermaid
%%{init:{"theme":"forest"}}%%
erDiagram
  CUSTOMER }|..|{ DELIVERY-ADDRESS : has
  CUSTOMER ||--o{ ORDER : places
  CUSTOMER ||--o{ INVOICE : "liable for"
  DELIVERY-ADDRESS ||--o{ ORDER : receives
  INVOICE ||--|{ ORDER : covers
  ORDER ||--|{ ORDER-ITEM : includes
  PRODUCT-CATEGORY ||--|{ PRODUCT : contains
  PRODUCT ||--o{ ORDER-ITEM : "ordered in"
```
{{< mermaid >}}
%%{init:{"theme":"forest"}}%%
erDiagram
  CUSTOMER }|..|{ DELIVERY-ADDRESS : has
  CUSTOMER ||--o{ ORDER : places
  CUSTOMER ||--o{ INVOICE : "liable for"
  DELIVERY-ADDRESS ||--o{ ORDER : receives
  INVOICE ||--|{ ORDER : covers
  ORDER ||--|{ ORDER-ITEM : includes
  PRODUCT-CATEGORY ||--|{ PRODUCT : contains
  PRODUCT ||--o{ ORDER-ITEM : "ordered in"
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "%%{init:{\"theme\":\"forest\"}}%%\nerDiagram\n  CUSTOMER }|..|{ DELIVERY-ADDRESS : has\n  CUSTOMER ||--o{ ORDER : places\n  CUSTOMER ||--o{ INVOICE : \"liable for\"\n  DELIVERY-ADDRESS ||--o{ ORDER : receives\n  INVOICE ||--|{ ORDER : covers\n  ORDER ||--|{ ORDER-ITEM : includes\n  PRODUCT-CATEGORY ||--|{ PRODUCT : contains\n  PRODUCT ||--o{ ORDER-ITEM : \"ordered in\""
)}}
%%{init:{"theme":"forest"}}%%
erDiagram
  CUSTOMER }|..|{ DELIVERY-ADDRESS : has
  CUSTOMER ||--o{ ORDER : places
  CUSTOMER ||--o{ INVOICE : "liable for"
  DELIVERY-ADDRESS ||--o{ ORDER : receives
  INVOICE ||--|{ ORDER : covers
  ORDER ||--|{ ORDER-ITEM : includes
  PRODUCT-CATEGORY ||--|{ PRODUCT : contains
  PRODUCT ||--o{ ORDER-ITEM : "ordered in"

User Journey

​
```mermaid
journey
  title My working day
  section Go to work
    Make tea: 5: Me
    Go upstairs: 3: Me
    Do work: 1: Me, Cat
  section Go home
    Go downstairs: 5: Me
    Sit down: 3: Me
```
{{< mermaid >}}
journey
  title My working day
  section Go to work
    Make tea: 5: Me
    Go upstairs: 3: Me
    Do work: 1: Me, Cat
  section Go home
    Go downstairs: 5: Me
    Sit down: 3: Me
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "journey\n  title My working day\n  section Go to work\n    Make tea: 5: Me\n    Go upstairs: 3: Me\n    Do work: 1: Me, Cat\n  section Go home\n    Go downstairs: 5: Me\n    Sit down: 3: Me"
)}}
journey
  title My working day
  section Go to work
    Make tea: 5: Me
    Go upstairs: 3: Me
    Do work: 1: Me, Cat
  section Go home
    Go downstairs: 5: Me
    Sit down: 3: Me

GANTT Chart

​
```mermaid
gantt
  dateFormat  YYYY-MM-DD
  title Adding GANTT diagram functionality to Mermaid
  section A section
  Completed task            :done,    des1, 2014-01-06,2014-01-08
  Active task               :active,  des2, 2014-01-09, 3d
  Future task               :         des3, after des2, 5d
  Future task2              :         des4, after des3, 5d
  section Critical tasks
  Completed task in the critical line :crit, done, 2014-01-06,24h
  Implement parser and jison          :crit, done, after des1, 2d
  Create tests for parser             :crit, active, 3d
  Future task in critical line        :crit, 5d
  Create tests for renderer           :2d
  Add to Mermaid                      :1d
```
{{< mermaid >}}
gantt
  dateFormat  YYYY-MM-DD
  title Adding GANTT diagram functionality to Mermaid
  section A section
  Completed task            :done,    des1, 2014-01-06,2014-01-08
  Active task               :active,  des2, 2014-01-09, 3d
  Future task               :         des3, after des2, 5d
  Future task2              :         des4, after des3, 5d
  section Critical tasks
  Completed task in the critical line :crit, done, 2014-01-06,24h
  Implement parser and jison          :crit, done, after des1, 2d
  Create tests for parser             :crit, active, 3d
  Future task in critical line        :crit, 5d
  Create tests for renderer           :2d
  Add to Mermaid                      :1d
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "gantt\n  dateFormat  YYYY-MM-DD\n  title Adding GANTT diagram functionality to Mermaid\n  section A section\n  Completed task            :done,    des1, 2014-01-06,2014-01-08\n  Active task               :active,  des2, 2014-01-09, 3d\n  Future task               :         des3, after des2, 5d\n  Future task2              :         des4, after des3, 5d\n  section Critical tasks\n  Completed task in the critical line :crit, done, 2014-01-06,24h\n  Implement parser and jison          :crit, done, after des1, 2d\n  Create tests for parser             :crit, active, 3d\n  Future task in critical line        :crit, 5d\n  Create tests for renderer           :2d\n  Add to Mermaid                      :1d"
)}}
gantt
  dateFormat  YYYY-MM-DD
  title Adding GANTT diagram functionality to Mermaid
  section A section
  Completed task            :done,    des1, 2014-01-06,2014-01-08
  Active task               :active,  des2, 2014-01-09, 3d
  Future task               :         des3, after des2, 5d
  Future task2              :         des4, after des3, 5d
  section Critical tasks
  Completed task in the critical line :crit, done, 2014-01-06,24h
  Implement parser and jison          :crit, done, after des1, 2d
  Create tests for parser             :crit, active, 3d
  Future task in critical line        :crit, 5d
  Create tests for renderer           :2d
  Add to Mermaid                      :1d

Pie Chart without Zoom

​
```mermaid {zoom="false"}
pie title Pets adopted by volunteers
  "Dogs" : 386
  "Cats" : 85
  "Rats" : 15
```
{{< mermaid zoom="false" >}}
pie title Pets adopted by volunteers
  "Dogs" : 386
  "Cats" : 85
  "Rats" : 15
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "pie title Pets adopted by volunteers\n  \"Dogs\" : 386\n  \"Cats\" : 85\n  \"Rats\" : 15"
  "zoom" "false"
)}}
pie title Pets adopted by volunteers
  "Dogs" : 386
  "Cats" : 85
  "Rats" : 15

Quadrant Chart

​
```mermaid
quadrantChart
  title Reach and engagement of campaigns
  x-axis Low Reach --> High Reach
  y-axis Low Engagement --> High Engagement
  quadrant-1 We should expand
  quadrant-2 Need to promote
  quadrant-3 Re-evaluate
  quadrant-4 May be improved
  Campaign A: [0.3, 0.6]
  Campaign B: [0.45, 0.23]
  Campaign C: [0.57, 0.69]
  Campaign D: [0.78, 0.34]
  Campaign E: [0.40, 0.34]
  Campaign F: [0.35, 0.78]
```
{{< mermaid >}}
quadrantChart
  title Reach and engagement of campaigns
  x-axis Low Reach --> High Reach
  y-axis Low Engagement --> High Engagement
  quadrant-1 We should expand
  quadrant-2 Need to promote
  quadrant-3 Re-evaluate
  quadrant-4 May be improved
  Campaign A: [0.3, 0.6]
  Campaign B: [0.45, 0.23]
  Campaign C: [0.57, 0.69]
  Campaign D: [0.78, 0.34]
  Campaign E: [0.40, 0.34]
  Campaign F: [0.35, 0.78]
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "quadrantChart\n  title Reach and engagement of campaigns\n  x-axis Low Reach --> High Reach\n  y-axis Low Engagement --> High Engagement\n  quadrant-1 We should expand\n  quadrant-2 Need to promote\n  quadrant-3 Re-evaluate\n  quadrant-4 May be improved\n  Campaign A: [0.3, 0.6]\n  Campaign B: [0.45, 0.23]\n  Campaign C: [0.57, 0.69]\n  Campaign D: [0.78, 0.34]\n  Campaign E: [0.40, 0.34]\n  Campaign F: [0.35, 0.78]"
)}}
quadrantChart
  title Reach and engagement of campaigns
  x-axis Low Reach --> High Reach
  y-axis Low Engagement --> High Engagement
  quadrant-1 We should expand
  quadrant-2 Need to promote
  quadrant-3 Re-evaluate
  quadrant-4 May be improved
  Campaign A: [0.3, 0.6]
  Campaign B: [0.45, 0.23]
  Campaign C: [0.57, 0.69]
  Campaign D: [0.78, 0.34]
  Campaign E: [0.40, 0.34]
  Campaign F: [0.35, 0.78]

Requirement Diagram

​
```mermaid
requirementDiagram

  requirement test_req {
    id: 1
    text: the test text.
    risk: high
    verifymethod: test
  }

  element test_entity {
    type: simulation
  }

  test_entity - satisfies -> test_req
```
{{< mermaid >}}
requirementDiagram

  requirement test_req {
    id: 1
    text: the test text.
    risk: high
    verifymethod: test
  }

  element test_entity {
    type: simulation
  }

  test_entity - satisfies -> test_req
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "requirementDiagram\n\n  requirement test_req {\n    id: 1\n    text: the test text.\n    risk: high\n    verifymethod: test\n  }\n\n  element test_entity {\n    type: simulation\n  }\n\n  test_entity - satisfies -> test_req"
)}}
requirementDiagram

  requirement test_req {
    id: 1
    text: the test text.
    risk: high
    verifymethod: test
  }

  element test_entity {
    type: simulation
  }

  test_entity - satisfies -> test_req

Git Graph

​
```mermaid
gitGraph
  commit
  commit
  branch develop
  checkout develop
  commit
  commit
  checkout main
  merge develop
  commit
  commit
```
{{< mermaid >}}
gitGraph
  commit
  commit
  branch develop
  checkout develop
  commit
  commit
  checkout main
  merge develop
  commit
  commit
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "gitGraph\n  commit\n  commit\n  branch develop\n  checkout develop\n  commit\n  commit\n  checkout main\n  merge develop\n  commit\n  commit"
)}}
gitGraph
  commit
  commit
  branch develop
  checkout develop
  commit
  commit
  checkout main
  merge develop
  commit
  commit

C4 Diagrams

​
```mermaid
C4Context
  title System Context diagram for Internet Banking System
  Enterprise_Boundary(b0, "BankBoundary0") {
    Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
    Person(customerB, "Banking Customer B")
    Person_Ext(customerC, "Banking Customer C", "desc")
    Person(customerD, "Banking Customer D", "A customer of the bank, <br/> with personal bank accounts.")

    System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")

    Enterprise_Boundary(b1, "BankBoundary") {
      SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")

      System_Boundary(b2, "BankBoundary2") {
        System(SystemA, "Banking System A")
        System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts. next line.")
      }

      System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
      SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")

      Boundary(b3, "BankBoundary3", "boundary") {
        SystemQueue(SystemF, "Banking System F Queue", "A system of the bank.")
        SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
      }
    }
  }

  BiRel(customerA, SystemAA, "Uses")
  BiRel(SystemAA, SystemE, "Uses")
  Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
  Rel(SystemC, customerA, "Sends e-mails to")

  UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
  UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
  UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
  UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
  UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")

  UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
```
{{< mermaid >}}
C4Context
  title System Context diagram for Internet Banking System
  Enterprise_Boundary(b0, "BankBoundary0") {
    Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
    Person(customerB, "Banking Customer B")
    Person_Ext(customerC, "Banking Customer C", "desc")
    Person(customerD, "Banking Customer D", "A customer of the bank, <br/> with personal bank accounts.")

    System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")

    Enterprise_Boundary(b1, "BankBoundary") {
      SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")

      System_Boundary(b2, "BankBoundary2") {
        System(SystemA, "Banking System A")
        System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts. next line.")
      }

      System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
      SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")

      Boundary(b3, "BankBoundary3", "boundary") {
        SystemQueue(SystemF, "Banking System F Queue", "A system of the bank.")
        SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
      }
    }
  }

  BiRel(customerA, SystemAA, "Uses")
  BiRel(SystemAA, SystemE, "Uses")
  Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
  Rel(SystemC, customerA, "Sends e-mails to")

  UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
  UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
  UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
  UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
  UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")

  UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "C4Context\n  title System Context diagram for Internet Banking System\n  Enterprise_Boundary(b0, \"BankBoundary0\") {\n    Person(customerA, \"Banking Customer A\", \"A customer of the bank, with personal bank accounts.\")\n    Person(customerB, \"Banking Customer B\")\n    Person_Ext(customerC, \"Banking Customer C\", \"desc\")\n    Person(customerD, \"Banking Customer D\", \"A customer of the bank, <br/> with personal bank accounts.\")\n\n    System(SystemAA, \"Internet Banking System\", \"Allows customers to view information about their bank accounts, and make payments.\")\n\n    Enterprise_Boundary(b1, \"BankBoundary\") {\n      SystemDb_Ext(SystemE, \"Mainframe Banking System\", \"Stores all of the core banking information about customers, accounts, transactions, etc.\")\n\n      System_Boundary(b2, \"BankBoundary2\") {\n        System(SystemA, \"Banking System A\")\n        System(SystemB, \"Banking System B\", \"A system of the bank, with personal bank accounts. next line.\")\n      }\n\n      System_Ext(SystemC, \"E-mail system\", \"The internal Microsoft Exchange e-mail system.\")\n      SystemDb(SystemD, \"Banking System D Database\", \"A system of the bank, with personal bank accounts.\")\n\n      Boundary(b3, \"BankBoundary3\", \"boundary\") {\n        SystemQueue(SystemF, \"Banking System F Queue\", \"A system of the bank.\")\n        SystemQueue_Ext(SystemG, \"Banking System G Queue\", \"A system of the bank, with personal bank accounts.\")\n      }\n    }\n  }\n\n  BiRel(customerA, SystemAA, \"Uses\")\n  BiRel(SystemAA, SystemE, \"Uses\")\n  Rel(SystemAA, SystemC, \"Sends e-mails\", \"SMTP\")\n  Rel(SystemC, customerA, \"Sends e-mails to\")\n\n  UpdateElementStyle(customerA, $fontColor=\"red\", $bgColor=\"grey\", $borderColor=\"red\")\n  UpdateRelStyle(customerA, SystemAA, $textColor=\"blue\", $lineColor=\"blue\", $offsetX=\"5\")\n  UpdateRelStyle(SystemAA, SystemE, $textColor=\"blue\", $lineColor=\"blue\", $offsetY=\"-10\")\n  UpdateRelStyle(SystemAA, SystemC, $textColor=\"blue\", $lineColor=\"blue\", $offsetY=\"-40\", $offsetX=\"-50\")\n  UpdateRelStyle(SystemC, customerA, $textColor=\"red\", $lineColor=\"red\", $offsetX=\"-50\", $offsetY=\"20\")\n\n  UpdateLayoutConfig($c4ShapeInRow=\"3\", $c4BoundaryInRow=\"1\")"
)}}
C4Context
  title System Context diagram for Internet Banking System
  Enterprise_Boundary(b0, "BankBoundary0") {
    Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
    Person(customerB, "Banking Customer B")
    Person_Ext(customerC, "Banking Customer C", "desc")
    Person(customerD, "Banking Customer D", "A customer of the bank, <br/> with personal bank accounts.")

    System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")

    Enterprise_Boundary(b1, "BankBoundary") {
      SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")

      System_Boundary(b2, "BankBoundary2") {
        System(SystemA, "Banking System A")
        System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts. next line.")
      }

      System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
      SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")

      Boundary(b3, "BankBoundary3", "boundary") {
        SystemQueue(SystemF, "Banking System F Queue", "A system of the bank.")
        SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
      }
    }
  }

  BiRel(customerA, SystemAA, "Uses")
  BiRel(SystemAA, SystemE, "Uses")
  Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
  Rel(SystemC, customerA, "Sends e-mails to")

  UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
  UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
  UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
  UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
  UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")

  UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")

Mindmaps

​
```mermaid
mindmap
  root((mindmap))
    Origins
      Long history
      ::icon(fa fa-book)
      Popularisation
        British popular psychology author Tony Buzan
    Research
      On effectiveness<br/>and features
      On Automatic creation
        Uses
            Creative techniques
            Strategic planning
            Argument mapping
    Tools
      Pen and paper
      Mermaid
```
{{< mermaid >}}
mindmap
  root((mindmap))
    Origins
      Long history
      ::icon(fa fa-book)
      Popularisation
        British popular psychology author Tony Buzan
    Research
      On effectiveness<br/>and features
      On Automatic creation
        Uses
            Creative techniques
            Strategic planning
            Argument mapping
    Tools
      Pen and paper
      Mermaid
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "mindmap\n  root((mindmap))\n    Origins\n      Long history\n      ::icon(fa fa-book)\n      Popularisation\n        British popular psychology author Tony Buzan\n    Research\n      On effectiveness<br/>and features\n      On Automatic creation\n        Uses\n            Creative techniques\n            Strategic planning\n            Argument mapping\n    Tools\n      Pen and paper\n      Mermaid"
)}}
mindmap
  root((mindmap))
    Origins
      Long history
      ::icon(fa fa-book)
      Popularisation
        British popular psychology author Tony Buzan
    Research
      On effectiveness<br/>and features
      On Automatic creation
        Uses
            Creative techniques
            Strategic planning
            Argument mapping
    Tools
      Pen and paper
      Mermaid

Timeline

​
```mermaid
timeline
  title History of Social Media Platform
  2002 : LinkedIn
  2004 : Facebook
       : Google
  2005 : Youtube
  2006 : Twitter
```
{{< mermaid >}}
timeline
  title History of Social Media Platform
  2002 : LinkedIn
  2004 : Facebook
       : Google
  2005 : Youtube
  2006 : Twitter
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "timeline\n  title History of Social Media Platform\n  2002 : LinkedIn\n  2004 : Facebook\n       : Google\n  2005 : Youtube\n  2006 : Twitter"
)}}
timeline
  title History of Social Media Platform
  2002 : LinkedIn
  2004 : Facebook
       : Google
  2005 : Youtube
  2006 : Twitter

ZenUML

ZenUML is currently not available with the Mermaid version shipped with the theme due to further required dependencies. Use sequence diagrams instead.

Sankey

​
```mermaid
sankey-beta
  %% source,target,value
  Electricity grid,Over generation / exports,104.453
  Electricity grid,Heating and cooling - homes,113.726
  Electricity grid,H2 conversion,27.14
```
{{< mermaid >}}
sankey-beta
  %% source,target,value
  Electricity grid,Over generation / exports,104.453
  Electricity grid,Heating and cooling - homes,113.726
  Electricity grid,H2 conversion,27.14
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "sankey-beta\n  %% source,target,value\n  Electricity grid,Over generation / exports,104.453\n  Electricity grid,Heating and cooling - homes,113.726\n  Electricity grid,H2 conversion,27.14"
)}}
sankey-beta
  %% source,target,value
  Electricity grid,Over generation / exports,104.453
  Electricity grid,Heating and cooling - homes,113.726
  Electricity grid,H2 conversion,27.14

XYChart

​
```mermaid
xychart-beta
  title "Sales Revenue"
  x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
  y-axis "Revenue (in $)" 4000 --> 11000
  bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
  line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
```
{{< mermaid >}}
xychart-beta
  title "Sales Revenue"
  x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
  y-axis "Revenue (in $)" 4000 --> 11000
  bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
  line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "xychart-beta\n  title \"Sales Revenue\"\n  x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]\n  y-axis \"Revenue (in $)\" 4000 --> 11000\n  bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n  line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]"
)}}
xychart-beta
  title "Sales Revenue"
  x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
  y-axis "Revenue (in $)" 4000 --> 11000
  bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
  line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]

Block Diagram

​
```mermaid
block-beta
  columns 1
    db(("DB"))
    blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
    block:ID
      A
      B["A wide one in the middle"]
      C
    end
    space
    D
    ID --> D
    C --> D
    style B fill:#969,stroke:#333,stroke-width:4px
```
{{< mermaid >}}
block-beta
  columns 1
    db(("DB"))
    blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
    block:ID
      A
      B["A wide one in the middle"]
      C
    end
    space
    D
    ID --> D
    C --> D
    style B fill:#969,stroke:#333,stroke-width:4px
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "block-beta\n  columns 1\n    db((\"DB\"))\n    blockArrowId6<[\"&nbsp;&nbsp;&nbsp;\"]>(down)\n    block:ID\n      A\n      B[\"A wide one in the middle\"]\n      C\n    end\n    space\n    D\n    ID --> D\n    C --> D\n    style B fill:#969,stroke:#333,stroke-width:4px"
)}}
block-beta
  columns 1
    db(("DB"))
    blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
    block:ID
      A
      B["A wide one in the middle"]
      C
    end
    space
    D
    ID --> D
    C --> D
    style B fill:#969,stroke:#333,stroke-width:4px

Packet

​
```mermaid
---
title: "TCP Packet"
---
packet-beta
  0-15: "Source Port"
  16-31: "Destination Port"
  32-63: "Sequence Number"
  64-95: "Acknowledgment Number"
  96-99: "Data Offset"
  100-105: "Reserved"
  106: "URG"
  107: "ACK"
  108: "PSH"
  109: "RST"
  110: "SYN"
  111: "FIN"
  112-127: "Window"
  128-143: "Checksum"
  144-159: "Urgent Pointer"
  160-191: "(Options and Padding)"
  192-255: "Data (variable length)"
```
{{< mermaid >}}
---
title: "TCP Packet"
---
packet-beta
  0-15: "Source Port"
  16-31: "Destination Port"
  32-63: "Sequence Number"
  64-95: "Acknowledgment Number"
  96-99: "Data Offset"
  100-105: "Reserved"
  106: "URG"
  107: "ACK"
  108: "PSH"
  109: "RST"
  110: "SYN"
  111: "FIN"
  112-127: "Window"
  128-143: "Checksum"
  144-159: "Urgent Pointer"
  160-191: "(Options and Padding)"
  192-255: "Data (variable length)"
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "---\ntitle: \"TCP Packet\"\n---\npacket-beta\n  0-15: \"Source Port\"\n  16-31: \"Destination Port\"\n  32-63: \"Sequence Number\"\n  64-95: \"Acknowledgment Number\"\n  96-99: \"Data Offset\"\n  100-105: \"Reserved\"\n  106: \"URG\"\n  107: \"ACK\"\n  108: \"PSH\"\n  109: \"RST\"\n  110: \"SYN\"\n  111: \"FIN\"\n  112-127: \"Window\"\n  128-143: \"Checksum\"\n  144-159: \"Urgent Pointer\"\n  160-191: \"(Options and Padding)\"\n  192-255: \"Data (variable length)\""
)}}
---
title: "TCP Packet"
---
packet-beta
  0-15: "Source Port"
  16-31: "Destination Port"
  32-63: "Sequence Number"
  64-95: "Acknowledgment Number"
  96-99: "Data Offset"
  100-105: "Reserved"
  106: "URG"
  107: "ACK"
  108: "PSH"
  109: "RST"
  110: "SYN"
  111: "FIN"
  112-127: "Window"
  128-143: "Checksum"
  144-159: "Urgent Pointer"
  160-191: "(Options and Padding)"
  192-255: "Data (variable length)"

Kanban

​
```mermaid
---
config:
  kanban:
    ticketBaseUrl: 'https://mermaidchart.atlassian.net/browse/#TICKET#'
---
kanban
  Todo
    [Create Documentation]
    docs[Create Blog about the new diagram]
  [In progress]
    id6[Create renderer so that it works in all cases. We also add som extra text here for testing purposes. And some more just for the extra flare.]
  id9[Ready for deploy]
    id8[Design grammar]@{ assigned: 'knsv' }
  id10[Ready for test]
    id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }
    id66[last item]@{ priority: 'Very Low', assigned: 'knsv' }
  id11[Done]
    id5[define getData]
    id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char]@{ ticket: MC-2036, priority: 'Very High'}
    id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }

  id12[Can't reproduce]
    id3[Weird flickering in Firefox]
```
{{< mermaid >}}
---
config:
  kanban:
    ticketBaseUrl: 'https://mermaidchart.atlassian.net/browse/#TICKET#'
---
kanban
  Todo
    [Create Documentation]
    docs[Create Blog about the new diagram]
  [In progress]
    id6[Create renderer so that it works in all cases. We also add som extra text here for testing purposes. And some more just for the extra flare.]
  id9[Ready for deploy]
    id8[Design grammar]@{ assigned: 'knsv' }
  id10[Ready for test]
    id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }
    id66[last item]@{ priority: 'Very Low', assigned: 'knsv' }
  id11[Done]
    id5[define getData]
    id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char]@{ ticket: MC-2036, priority: 'Very High'}
    id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }

  id12[Can't reproduce]
    id3[Weird flickering in Firefox]
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "---\nconfig:\n  kanban:\n    ticketBaseUrl: 'https://mermaidchart.atlassian.net/browse/#TICKET#'\n---\nkanban\n  Todo\n    [Create Documentation]\n    docs[Create Blog about the new diagram]\n  [In progress]\n    id6[Create renderer so that it works in all cases. We also add som extra text here for testing purposes. And some more just for the extra flare.]\n  id9[Ready for deploy]\n    id8[Design grammar]@{ assigned: 'knsv' }\n  id10[Ready for test]\n    id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }\n    id66[last item]@{ priority: 'Very Low', assigned: 'knsv' }\n  id11[Done]\n    id5[define getData]\n    id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char]@{ ticket: MC-2036, priority: 'Very High'}\n    id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }\n\n  id12[Can't reproduce]\n    id3[Weird flickering in Firefox]"
)}}
---
config:
  kanban:
    ticketBaseUrl: 'https://mermaidchart.atlassian.net/browse/#TICKET#'
---
kanban
  Todo
    [Create Documentation]
    docs[Create Blog about the new diagram]
  [In progress]
    id6[Create renderer so that it works in all cases. We also add som extra text here for testing purposes. And some more just for the extra flare.]
  id9[Ready for deploy]
    id8[Design grammar]@{ assigned: 'knsv' }
  id10[Ready for test]
    id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }
    id66[last item]@{ priority: 'Very Low', assigned: 'knsv' }
  id11[Done]
    id5[define getData]
    id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char]@{ ticket: MC-2036, priority: 'Very High'}
    id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }

  id12[Can't reproduce]
    id3[Weird flickering in Firefox]

Architecture

​
```mermaid
architecture-beta
  group api(cloud)[API]

  service db(database)[Database] in api
  service disk1(disk)[Storage] in api
  service disk2(disk)[Storage] in api
  service server(server)[Server] in api

  db:L -- R:server
  disk1:T -- B:server
  disk2:T -- B:db
```
{{< mermaid >}}
architecture-beta
  group api(cloud)[API]

  service db(database)[Database] in api
  service disk1(disk)[Storage] in api
  service disk2(disk)[Storage] in api
  service server(server)[Server] in api

  db:L -- R:server
  disk1:T -- B:server
  disk2:T -- B:db
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "architecture-beta\n  group api(cloud)[API]\n\n  service db(database)[Database] in api\n  service disk1(disk)[Storage] in api\n  service disk2(disk)[Storage] in api\n  service server(server)[Server] in api\n\n  db:L -- R:server\n  disk1:T -- B:server\n  disk2:T -- B:db"
)}}
architecture-beta
  group api(cloud)[API]

  service db(database)[Database] in api
  service disk1(disk)[Storage] in api
  service disk2(disk)[Storage] in api
  service server(server)[Server] in api

  db:L -- R:server
  disk1:T -- B:server
  disk2:T -- B:db

Radar

​
```mermaid
---
title: "Grades"
---
radar-beta
  axis m["Math"], s["Science"], e["English"]
  axis h["History"], g["Geography"], a["Art"]
  curve a["Alice"]{85, 90, 80, 70, 75, 90}
  curve b["Bob"]{70, 75, 85, 80, 90, 85}

  max 100
  min 0
```
{{< mermaid >}}
---
title: "Grades"
---
radar-beta
  axis m["Math"], s["Science"], e["English"]
  axis h["History"], g["Geography"], a["Art"]
  curve a["Alice"]{85, 90, 80, 70, 75, 90}
  curve b["Bob"]{70, 75, 85, 80, 90, 85}

  max 100
  min 0
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "---\ntitle: \"Grades\"\n---\nradar-beta\n  axis m[\"Math\"], s[\"Science\"], e[\"English\"]\n  axis h[\"History\"], g[\"Geography\"], a[\"Art\"]\n  curve a[\"Alice\"]{85, 90, 80, 70, 75, 90}\n  curve b[\"Bob\"]{70, 75, 85, 80, 90, 85}\n\n  max 100\n  min 0"
)}}
---
title: "Grades"
---
radar-beta
  axis m["Math"], s["Science"], e["English"]
  axis h["History"], g["Geography"], a["Art"]
  curve a["Alice"]{85, 90, 80, 70, 75, 90}
  curve b["Bob"]{70, 75, 85, 80, 90, 85}

  max 100
  min 0

Treemap

​
```mermaid
treemap-beta
"Section 1"
    "Leaf 1.1": 12
    "Section 1.2"
      "Leaf 1.2.1": 12
"Section 2"
    "Leaf 2.1": 20
    "Leaf 2.2": 25
```
{{< mermaid >}}
treemap-beta
"Section 1"
    "Leaf 1.1": 12
    "Section 1.2"
      "Leaf 1.2.1": 12
"Section 2"
    "Leaf 2.1": 20
    "Leaf 2.2": 25
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "treemap-beta\n\"Section 1\"\n    \"Leaf 1.1\": 12\n    \"Section 1.2\"\n      \"Leaf 1.2.1\": 12\n\"Section 2\"\n    \"Leaf 2.1\": 20\n    \"Leaf 2.2\": 25"
)}}
treemap-beta
"Section 1"
    "Leaf 1.1": 12
    "Section 1.2"
      "Leaf 1.2.1": 12
"Section 2"
    "Leaf 2.1": 20
    "Leaf 2.2": 25

Venn

​
```mermaid
venn-beta
  title "Team overlap"
  set Frontend
  set Backend
  union Frontend,Backend["APIs"]
```
{{< mermaid >}}
venn-beta
  title "Team overlap"
  set Frontend
  set Backend
  union Frontend,Backend["APIs"]
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "venn-beta\n  title \"Team overlap\"\n  set Frontend\n  set Backend\n  union Frontend,Backend[\"APIs\"]"
)}}
venn-beta
  title "Team overlap"
  set Frontend
  set Backend
  union Frontend,Backend["APIs"]

Ishikawa

​
```mermaid
ishikawa-beta
  Blurry Photo
  Process
      Out of focus
      Shutter speed too slow
      Protective film not removed
      Beautification filter applied
  User
      Shaky hands
  Equipment
      LENS
          Inappropriate lens
          Damaged lens
          Dirty lens
      SENSOR
          Damaged sensor
          Dirty sensor
  Environment
      Subject moved too quickly
      Too dark
```
{{< mermaid >}}
ishikawa-beta
  Blurry Photo
  Process
      Out of focus
      Shutter speed too slow
      Protective film not removed
      Beautification filter applied
  User
      Shaky hands
  Equipment
      LENS
          Inappropriate lens
          Damaged lens
          Dirty lens
      SENSOR
          Damaged sensor
          Dirty sensor
  Environment
      Subject moved too quickly
      Too dark
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "ishikawa-beta\n  Blurry Photo\n  Process\n      Out of focus\n      Shutter speed too slow\n      Protective film not removed\n      Beautification filter applied\n  User\n      Shaky hands\n  Equipment\n      LENS\n          Inappropriate lens\n          Damaged lens\n          Dirty lens\n      SENSOR\n          Damaged sensor\n          Dirty sensor\n  Environment\n      Subject moved too quickly\n      Too dark"
)}}
ishikawa-beta
  Blurry Photo
  Process
      Out of focus
      Shutter speed too slow
      Protective film not removed
      Beautification filter applied
  User
      Shaky hands
  Equipment
      LENS
          Inappropriate lens
          Damaged lens
          Dirty lens
      SENSOR
          Damaged sensor
          Dirty sensor
  Environment
      Subject moved too quickly
      Too dark

Wardley

​
```mermaid
wardley-beta
  title Tea Shop Value Chain

  anchor Business [0.95, 0.63]
  component Cup of Tea [0.79, 0.61]
  component Tea [0.63, 0.81]
  component Hot Water [0.52, 0.80]
  component Kettle [0.43, 0.35]
  component Power [0.10, 0.70]

  Business -> Cup of Tea
  Cup of Tea -> Tea
  Cup of Tea -> Hot Water
  Hot Water -> Kettle
  Kettle -> Power

  evolve Kettle 0.62
  evolve Power 0.89

  note "Standardising power allows Kettles to evolve faster" [0.30, 0.49]
```
{{< mermaid >}}
wardley-beta
  title Tea Shop Value Chain

  anchor Business [0.95, 0.63]
  component Cup of Tea [0.79, 0.61]
  component Tea [0.63, 0.81]
  component Hot Water [0.52, 0.80]
  component Kettle [0.43, 0.35]
  component Power [0.10, 0.70]

  Business -> Cup of Tea
  Cup of Tea -> Tea
  Cup of Tea -> Hot Water
  Hot Water -> Kettle
  Kettle -> Power

  evolve Kettle 0.62
  evolve Power 0.89

  note "Standardising power allows Kettles to evolve faster" [0.30, 0.49]
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "wardley-beta\n  title Tea Shop Value Chain\n\n  anchor Business [0.95, 0.63]\n  component Cup of Tea [0.79, 0.61]\n  component Tea [0.63, 0.81]\n  component Hot Water [0.52, 0.80]\n  component Kettle [0.43, 0.35]\n  component Power [0.10, 0.70]\n\n  Business -> Cup of Tea\n  Cup of Tea -> Tea\n  Cup of Tea -> Hot Water\n  Hot Water -> Kettle\n  Kettle -> Power\n\n  evolve Kettle 0.62\n  evolve Power 0.89\n\n  note \"Standardising power allows Kettles to evolve faster\" [0.30, 0.49]"
)}}
wardley-beta
  title Tea Shop Value Chain

  anchor Business [0.95, 0.63]
  component Cup of Tea [0.79, 0.61]
  component Tea [0.63, 0.81]
  component Hot Water [0.52, 0.80]
  component Kettle [0.43, 0.35]
  component Power [0.10, 0.70]

  Business -> Cup of Tea
  Cup of Tea -> Tea
  Cup of Tea -> Hot Water
  Hot Water -> Kettle
  Kettle -> Power

  evolve Kettle 0.62
  evolve Power 0.89

  note "Standardising power allows Kettles to evolve faster" [0.30, 0.49]

Cynefin

​
```mermaid
cynefin-beta
title Optional Diagram Title

complex
"Item label"
"Another item"

complicated
"Expert analysis needed"

clear
"Known procedure"

chaotic
"Crisis response"

confusion
"Item of unknown domain"

complex --> complicated : "Pattern identified"
clear --> chaotic : "Complacency"
```
{{< mermaid >}}
cynefin-beta
title Optional Diagram Title

complex
"Item label"
"Another item"

complicated
"Expert analysis needed"

clear
"Known procedure"

chaotic
"Crisis response"

confusion
"Item of unknown domain"

complex --> complicated : "Pattern identified"
clear --> chaotic : "Complacency"
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "cynefin-beta\ntitle Optional Diagram Title\n\ncomplex\n\"Item label\"\n\"Another item\"\n\ncomplicated\n\"Expert analysis needed\"\n\nclear\n\"Known procedure\"\n\nchaotic\n\"Crisis response\"\n\nconfusion\n\"Item of unknown domain\"\n\ncomplex --> complicated : \"Pattern identified\"\nclear --> chaotic : \"Complacency\""
)}}
cynefin-beta
title Optional Diagram Title

complex
"Item label"
"Another item"

complicated
"Expert analysis needed"

clear
"Known procedure"

chaotic
"Crisis response"

confusion
"Item of unknown domain"

complex --> complicated : "Pattern identified"
clear --> chaotic : "Complacency"

TreeView

​
```mermaid
treeView-beta
  my-project/
      src/
          index.js
      package.json
      README.md
```
{{< mermaid >}}
treeView-beta
  my-project/
      src/
          index.js
      package.json
      README.md
{{< /mermaid >}}
{{ partial "shortcodes/mermaid.html" (dict
  "page" .
  "content" "treeView-beta\n  my-project/\n      src/\n          index.js\n      package.json\n      README.md"
)}}
treeView-beta
  my-project/
      src/
          index.js
      package.json
      README.md

OpenAPI

The openapi shortcode displays your OpenAPI / Swagger specifications using the Swagger UI library.

Usage

​
{{< openapi src="https://petstore3.openapi.io/api/v3/openapi.json" >}}
{{ partial "shortcodes/openapi.html" (dict
  "page" .
  "src" "https://petstore3.openapi.io/api/v3/openapi.json"
)}}

If you want to print out (or generate a PDF) from your OpenAPI documentation, don’t initiate printing directly from the page because the elements are optimized for interactive usage in a browser.

Instead, open the print preview in your browser and initiate printing from that page. This page is optimized for reading and expands most of the available sections.

A specification that is a resource of your page or site is found by the search. A specification given by URL is loaded by the browser of your reader and is not.

Parameters

Name Default Notes
src <empty> The path to the to the OpenAPI specification resource or URL to be used. Resource paths adhere to Hugo’s logical path.
lang <empty> The language code used for the reading direction of the Swagger UI and for the texts the theme adds to it, like Expand all and Collapse all. This must be one of the languages configured for your site. If not set, the language of the page is used.

Settings

Option Front Matter You can use openapi.errorlevel to control what should happen if a local OpenAPI specification link cannot be resolved to a resource.

If not set or empty, any unresolved link is written as given into the resulting output. If set to warning the same happens and an additional warning is printed in the built console. If set to error an error message is printed and the build is aborted.

Please note that this cannot resolve files inside of your static directory. The file must be a resource of the page or the site.

Link warnings are also available for images & links and the include shortcode.

​
[params]
  [params.openapi]
    errorlevel = 'warning'
params:
  openapi:
    errorlevel: warning
{
   "params": {
      "openapi": {
         "errorlevel": "warning"
      }
   }
}

Using a Different Version of the Swagger UI Library

The theme uses the shipped Swagger UI library by default.

In case you want to use a different version of the Swagger UI library, store its files as assets/js/swagger-ui/swagger-ui-bundle.js, assets/js/swagger-ui/swagger-ui-standalone-preset.js and assets/css/swagger-ui/swagger-ui.css in your site. They replace the shipped version.

Force Loading of the Swagger UI Library

Option Front Matter The Swagger UI library will be loaded if the page contains an openapi shortcode or codefence.

You can force loading the Swagger UI library if no shortcode or codefence was used by setting openapi.force=true. If a shortcode or codefence was found, the option has no effect. This comes handy in case you are using scripting to render a spec.

​
[params]
  [params.openapi]
    force = true
params:
  openapi:
    force: true
{
   "params": {
      "openapi": {
         "force": true
      }
   }
}

Setting a Specific Swagger UI Theme

The recommended way to configure your Swagger UI theme is to set the default value using the --OPENAPI-theme and OPENAPI-CODE-theme variable in your color variant stylesheet. This allows your specs to look pretty when the user switches the color variant.

The theme uses Swaggers theming support. For --OPENAPI-theme the only allowed values are light or dark. For --OPENAPI-CODE-theme the allowed values are agate, arta, monokai, nord, obsidian, tomorrow-night, idea.

Example

Using Local File

​
{{< openapi src="petstore.json" >}}
{{ partial "shortcodes/openapi.html" (dict
  "page" .
  "src" "petstore.json"
)}}

Pages

The pages shortcode lists pages of your site in various display layouts, optionally grouped and ordered.

Usage

​
{{% pages pageref="fruits" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "pageref" "fruits"
)}}

A listing is made in two steps. First, a query retrieves the pages, filters, orders and groups them. Second, a display layout renders the result. Each parameter below belongs to one of the two. All parameters can also be set in the front matter.

The taxonomy and term pages are using this shortcode internally, and by using front matter you can modify the apperance. So everything described here applies to the taxonomy and term pages as well.

Query Parameters

The query assembles the pages as a internal tree structure, similar to the menu. A page dropped from the tree structure by hidden, kind or where takes all pages below it with it. If you want to list pages from any level, set flatten=true: the pages become one list and each page is kept or dropped on its own.

Name Default Notes
pageref <empty> A reference to the page whose pages are listed, like /shortcodes/pages/fruits or relative to the current page like fruits.

If set and it doesn’t resolve to a page, the build fails. If not set, the current page is used or, if called as partial, the page given in page.
axis see notes Along which axis the pages are collected, seen from the page.

- descendants: the children of the page, and with levels above 1 their descendants down to that many levels
- siblings: the other children of the page’s parent
- ancestors: the parent, its parent and so on, up to levels levels
- taxonomy: the terms of a taxonomy page
- term: the pages of a term page

Defaults to taxonomy on taxonomy pages, term on term pages and descendants everywhere else.
levels 1 For axis=descendants, how many levels to go down, for axis=ancestors, how many levels to go up. For example, axis=ancestors with levels=1 lists just the parent. To get all of them, set this to a high number, eg. 999.
flatten false When true, lists all collected pages as one list instead of a tree. Without orderby the pages keep the order of the tree, a parent before the pages below it; with orderby all pages are ordered together, and with groupby each page is grouped on its own.
kind all Which kind of pages to keep.

- all: every page
- leaf: only pages without pages of their own
- branch: only pages with pages of their own

In a tree, a page not kept is dropped together with the pages below it.
hidden false What to do with hidden pages.

- false: drop them, together with all pages below them
- true: keep them

For taxonomy and term pages this has no effect, as the disableTagHiddenPages Option decides here.
where <empty> Keeps only pages matching the condition <expression> <operator> <value>, see expressions.

- =, !=: equal, not equal
- <, <=, >, >=: less, greater
- in: equal to one of a comma separated list of values

A value may be delimited by ", ' or a backtick, which a value in the list of in needs if it contains a comma. Numbers and dates are compared by their value, everything else as text. A page missing the value only matches !=.

In a tree, a page not matching is dropped together with the pages below it.
groupby see notes Groups the pages by the value of an expression. Without a value, the pages are not grouped.

Defaults to linktitle | left 1 | upper on taxonomy and term pages without pages front matter and to no grouping everywhere else.

Pages for which the expression has no value are put into a last group of their own, labelled Other.
grouplabel <the value> The heading of each group, as an expression evaluated for the group’s first page.
grouporder asc The order of the groups.

- asc: ascending
- desc: descending
orderby see notes The order of the pages, as a comma separated list of expressions, each optionally followed by asc or desc. The first expression decides, the next ones break ties. An argument containing a comma has to be delimited, like date | format 'January 2, 2006'.

- auto keeps the order given by ordersectionsby of the page’s Front Matter
    or by ordersectionsby of the configuration Option
    or Hugo’s default order

Defaults to auto, except on taxonomy and term pages, which have no order of their own: there it defaults to linktitle, regardless of ordersectionsby.

Pages for which an expression has no value are put last.
limit <empty> Keeps only the first pages after ordering.

Display Parameters

The display renders the pages the query found, group by group if they were grouped. Grouping is optional: without groupby, all pages form one group without a heading. The shortcode writes each group’s heading, the display the pages below it, showing their level in the tree in its own way. The display parameters only decide how the pages look, never which pages are listed or in what order.

Name Default Notes
display tree How the pages are displayed, see how the displays differ.

- tree: a nested, unordered list of normal text
- headings: a non-nested list of headings depending on the page’s level
- sections: a heading for each page of the first level, a nested, unordered list of normal text for pages below
- list: a non-nested list of normal text
- cards: a card for each page, see below for details

You can write your own display.
headinglevel 2 The starting heading level. Headings of the headings and sections displays start one level below if the pages are grouped.
columns see notes The number of columns in full width mode. Accepts values from 1 to 5. Numbers are reduced when width gets smaller.

Defaults to 3 on taxonomy and term pages without pages front matter and for display=cards, and to 1 everywhere else. Has no effect for display=sections.
description false When true shows a short text under each page. When no description or summary exists for the page, the first 70 words of the content is taken - read more info about summaries on gohugo.io.
breadcrumb see notes When true shows the breadcrumb under each page.

Defaults to true on term pages unless the disableTermBreadcrumbs Option is set, and to false everywhere else.
image true For display=cards decides whether to put an image on the card.
cardtemplate default For display=cards the template to be used to display a card, see below for details.
params <empty> Arbitrary additional parameter for your own display or card template as string (JSON, TOML, YAML) or in a dict, like with the cards shortcode.

Configuration

To use this shortcode you need to enable block attributes in your hugo.toml.

hugo.
[markup]
  [markup.goldmark]
    [markup.goldmark.parser]
      [markup.goldmark.parser.attribute]
        block = true
markup:
  goldmark:
    parser:
      attribute:
        block: true
{
   "markup": {
      "goldmark": {
         "parser": {
            "attribute": {
               "block": true
            }
         }
      }
   }
}

Front Matter

Every parameter but pageref can also be set in the front matter of the page the shortcode is called in, as params.pages.<name>, eg. params.pages.display. The front matter adds to the parameters given to the shortcode. If a parameter is given in both, the shortcode wins. If the shortcode is called with pageref, no front matter is read, neither that of the calling page nor that of the referenced one. If you want to reset a parameter set elsewhere to no value, set it to a string containing only whitespace like " ".

Taxonomy and term pages are grouped by the first letter and shown in columns only as long as their front matter sets no pages parameter at all. Once it sets any, groupby and columns default to the same values as everywhere else, so you only get what you ask for.

As front matter works on every page, you can use Hugo’s cascade to give all listings of a subtree the same look, for example all cards in two columns.

​
+++
[[cascade]]
  [cascade.params]
    [cascade.params.pages]
      columns = 2
      display = 'cards'
+++
---
cascade:
- params:
    pages:
      columns: 2
      display: cards
---
{
   "cascade": [
      {
         "params": {
            "pages": {
               "columns": 2,
               "display": "cards"
            }
         }
      }
   ]
}

Expressions

The parameters where, groupby, grouplabel and orderby take expressions. An expression reads a value of a page and passes it through a pipeline of functions, each separated by |.

<field> [| <function> [<argument>]]...

In this notation, <…> stands for something you fill in, square brackets […] mark something as optional, and ... means the part before may be repeated.

Everything after a function’s name is its argument. An argument is either a number, written as is like left 1, or a text, delimited by ", ' or a backtick like format 'January 2, 2006'. The delimiters keep a | or a comma inside the text from separating the pipeline or the expressions of orderby. Inside a shortcode parameter delimited by ", use ' or a backtick.

Fields

Name Value
title the page’s title as shown in its heading, like Tag :: Foo for a term page
linktitle the title as shown in the menu, which is the page’s linkTitle or else its title
weight the weight; like for Hugo, a weight of 0 has no value
length the length of the content in characters
path the logical path
section the top-level section
date, lastmod, publishdate, expirydate the respective date; a date that is not set has no value
params.<name> a value of the page’s front matter params; use dots to reach deeper, like params.author.name; a list or a map has no value

Functions

A text argument is shown with its delimiters, like '<layout>', a number argument without, like <n>.

Name Result
upper the text in upper case
lower the text in lower case
trim the text without leading and trailing whitespace
left <n> the first n characters of the text
right <n> the last n characters of the text
translate ['<prefix>'] the text translated by your translation files, looked up by the optional prefix followed by the text
year the year of a date
month the month of a date as a number from 1 to 12
day the day of the month of a date
weekday the day of the week of a date as a number from 1 for Monday to 7 for Sunday
format '<layout>' a date formatted by a Hugo date layout, including the localized ones like :date_long
coalesce '<value>' the value if the expression has no value so far
default '<value>' the value if the expression has no value so far or it is zero or false

Where an expression yields numbers for some pages and text for others, the numbers come first, ordered by value, followed by the text, ordered as text - in both directions. A date counts as a number, while a number written as text in front matter, like '10', is text.

A group is always ordered by the value it was grouped by, never by its heading. For groupby ending in format, that value is the parts of the date the layout shows, so the groups come in calendar order - date | format '2006-01' orders its groups by year and month, and date | format 'January' orders them January to December, even for pages from different years.

So to show translated group headings while keeping the order of the untranslated values, use translate in grouplabel rather than in groupby. To order the groups alphabetically by their translation in each language instead, use translate in groupby.

In orderby, an expression ending in format orders the same way - date | format '2. January' orders by day and month, whatever the year.

Displays

The displays differ in how they show a page’s level below the listed page. With flatten=true all pages are on the same level, so every display shows them side by side.

Display List Titles Levels shown by Output
tree a nested, unordered list standard text indentation Markdown
headings a non-nested list headings, listed in the table of contents heading size, starting at headinglevel Markdown
sections a non-nested list for the first level, a nested, unordered list below headings on the first level, standard text below first level as headings at headinglevel, below by indentation Markdown
list a non-nested list standard text not shown Markdown
cards a card for each page card titles not shown HTML, see below

Display Template Parameters

A display is a partial in layouts/partials/pages, called once for each group. If you place a file layouts/partials/pages/mine.html into your site, you can use it with display=mine. The group heading is written by the shortcode, not by your display.

The partial is called with the following parameters:

Name Value
page the page whose pages are listed
group the group, with its Key, its heading as Label, Fallback being true for the group of pages without a value, and its Pages
pages the group’s pages, each with the Page itself, its display text as Label and its Level below the listed page, starting at 1
headinglevel the heading level to start with; already one level below the group heading if the pages are grouped
class the CSS classes to put on your outermost element
columns the columns parameter value, as a number
description the description parameter value, as true or false
breadcrumb the breadcrumb parameter value, as true or false
image the image parameter value, as true or false
cardtemplate the cardtemplate parameter value
levels the levels parameter value, as a number
hidden the hidden parameter value, as true or false
params the params parameter value, already turned into a dict

Remarks for the Cards Display

The cards display uses the cards shortcode to show each page as a card, using the default cardtemplate. With it the card will display

  • if image=true a featured image at the start selected by Hugo
  • the title of the page as card title
  • if description=true the summary

The cards display writes HTML. If you have goldmark.renderer.unsafe=false (which is the default if you don’t set it), you have to use {{< pages >}} instead of {{% pages %}}.

Own Card Templates

cardtemplate selects a card template as the template parameter of the cards shortcode does. Besides the card parameters, its params hold:

  • params.page: the displayed page
  • params.level: the displayed page’s level below the listed page
  • params.description: the description parameter value
  • every value of the params parameter of the pages shortcode; one with the same name as one above loses

Examples

The examples list the demo pages of the hidden Fruits section, which keeps them out of the menu.

Site Map

Every page of a section at any depth, hidden ones included, each with its description. The pages are ordered alphabetically by the title shown in the menu, as orderby is set; the weight the demo pages carry is ignored.

​
{{% pages description="true" hidden="true" levels="999" orderby="linktitle" pageref="fruits" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "description" "true"
  "hidden" "true"
  "levels" "999"
  "orderby" "linktitle"
  "pageref" "fruits"
)}}
  • Apple

    A sweet demo page, published in March 2021

  • Banana

    A sweet demo page, published in November 2020

  • Berries

    A demo section with pages of its own

  • Cherry

    A sour demo page, still a draft

  • Citrus (hidden)

    A hidden demo section with pages of its own

    • Kumquat (hidden)

      A hidden demo page below a hidden section

    • Lemon

      A demo page below a hidden section

    • Lime

      A demo page below a hidden section, still a draft

  • Durian

    A demo page without a flavor

Chapter Overview

A heading for each chapter with its description, and the pages of the chapter listed below it. Unlike the site map above, it sets no orderby, so the pages come in the default order, the same as in the menu: by weight, which the demo pages deliberately set against the alphabet.

​
{{% pages description="true" display="sections" headinglevel="4" levels="2" pageref="fruits" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "description" "true"
  "display" "sections"
  "headinglevel" "4"
  "levels" "2"
  "pageref" "fruits"
)}}

Berries

A demo section with pages of its own

Durian

A demo page without a flavor

Cherry

A sour demo page, still a draft

Banana

A sweet demo page, published in November 2020

Apple

A sweet demo page, published in March 2021

Glossary

All pages at any depth in an A-Z index, grouped by the first letter of the title shown. Only the pages of the first level are grouped; the pages below them are listed under their parent, so Cranberry appears in the group of Berries rather than under C. Set flatten=true to group every page by its own letter.

​
{{% pages groupby="linktitle | left 1 | upper" headinglevel="4" levels="999" pageref="fruits" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "groupby" "linktitle | left 1 | upper"
  "headinglevel" "4"
  "levels" "999"
  "pageref" "fruits"
)}}

A

B

C

D

What’s New

The two most recent published pages, from any depth.

​
{{% pages display="headings" flatten="true" headinglevel="4" kind="leaf" levels="999" limit="2" orderby="date desc" pageref="fruits" where="params.status = published" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "display" "headings"
  "flatten" "true"
  "headinglevel" "4"
  "kind" "leaf"
  "levels" "999"
  "limit" "2"
  "orderby" "date desc"
  "pageref" "fruits"
  "where" "params.status = published"
)}}

Blog Archive

All pages the menu shows, from any depth, newest first, grouped by year and month with the newest month first. The pages below the hidden Citrus section are left out, just as in the menu.

​
{{% pages display="list" flatten="true" groupby="date | format '2006-01'" grouporder="desc" headinglevel="4" kind="leaf" levels="999" orderby="date desc" pageref="fruits" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "display" "list"
  "flatten" "true"
  "groupby" "date | format '2006-01'"
  "grouporder" "desc"
  "headinglevel" "4"
  "kind" "leaf"
  "levels" "999"
  "orderby" "date desc"
  "pageref" "fruits"
)}}

2023-07

2023-01

2022-08

2021-03

2020-11

Seasonal Calendar

The pages by the month they were published in, pooled across years. The layout shows only the month’s name, so the groups come in calendar order, January to December, whatever the year of their pages.

​
{{% pages flatten="true" groupby="date | format 'January'" headinglevel="4" kind="leaf" levels="999" pageref="fruits" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "flatten" "true"
  "groupby" "date | format 'January'"
  "headinglevel" "4"
  "kind" "leaf"
  "levels" "999"
  "pageref" "fruits"
)}}

January

March

July

August

November

Status Board

Every page by its workflow status, hidden ones included, so drafts are easy to spot. With columns each group is spread over two columns in full width mode, keeping the long published group short.

The front matter holds the status as a plain key like draft. The headings show it translated by translate: with the prefix status- it looks up status-draft for draft and status-published for published in the site’s translation files. A status without a translation would show as it is. As the translation is only used as grouplabel, the groups keep the order of the keys. With translate in groupby instead, they would be ordered alphabetically by the translation of each language.

​
{{% pages columns="2" flatten="true" groupby="params.status" grouplabel="params.status | translate 'status-'" headinglevel="4" hidden="true" kind="leaf" levels="999" orderby="linktitle" pageref="fruits" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "columns" "2"
  "flatten" "true"
  "groupby" "params.status"
  "grouplabel" "params.status | translate 'status-'"
  "headinglevel" "4"
  "hidden" "true"
  "kind" "leaf"
  "levels" "999"
  "orderby" "linktitle"
  "pageref" "fruits"
)}}

In the Works

Ready to Eat

Top Picks by Flavor

The pages grouped by a front matter parameter, the best ones first. The demo page without a flavor has no value for the expression and is put into a last group of its own, labelled Other. To give it a value of its own instead, like groupby: "params.flavor | coalesce 'neutral'", use coalesce; its group is then ordered among the others. default does the same, but also replaces a value of zero or false. Within each group the pages are ordered by priority descending and by title if they have the same priority.

​
{{% pages columns="2" flatten="true" groupby="params.flavor" headinglevel="4" kind="leaf" levels="999" orderby="params.priority desc, title" pageref="fruits" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "columns" "2"
  "flatten" "true"
  "groupby" "params.flavor"
  "headinglevel" "4"
  "kind" "leaf"
  "levels" "999"
  "orderby" "params.priority desc, title"
  "pageref" "fruits"
)}}

sour

sweet

Other

The other pages next to a page, for a “see also” at its end.

​
{{% pages axis="siblings" pageref="fruits/apple" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "axis" "siblings"
  "pageref" "fruits/apple"
)}}

Where Am I

The sections a page sits in, the closest first. The Fruits section is hidden, so it is only listed with hidden.

​
{{% pages axis="ancestors" hidden="true" levels="3" pageref="fruits/berries/blueberry" %}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "axis" "ancestors"
  "hidden" "true"
  "levels" "3"
  "pageref" "fruits/berries/blueberry"
)}}

Landing Page Tiles

The sections and pages of a chapter as cards with their description, ordered alphabetically by the title shown instead of by weight. Each demo page is a page bundle containing a featured.png, which Hugo selects as the image of its card.

​
{{< pages description="true" display="cards" orderby="linktitle" pageref="fruits" >}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "description" "true"
  "display" "cards"
  "orderby" "linktitle"
  "pageref" "fruits"
)}}
  • A sweet demo page, published in March 2021
  • A sweet demo page, published in November 2020
  • A demo section with pages of its own
  • A sour demo page, still a draft

Picture Index

All pages at any depth, hidden ones included, as cards in an A-Z index. Within a letter the cards are ordered alphabetically by the title shown instead of by weight.

​
{{< pages display="cards" flatten="true" groupby="linktitle | left 1 | upper" headinglevel="4" hidden="true" kind="leaf" levels="999" orderby="linktitle" pageref="fruits" >}}
{{ partial "shortcodes/pages.html" (dict
  "page" .
  "display" "cards"
  "flatten" "true"
  "groupby" "linktitle | left 1 | upper"
  "headinglevel" "4"
  "hidden" "true"
  "kind" "leaf"
  "levels" "999"
  "orderby" "linktitle"
  "pageref" "fruits"
)}}

A

B

C

D

K

L

Resources

The resources shortcode displays links to resources contained in a page bundle.

Attachments

Usage

​
{{% resources sort="asc" /%}}
{{ partial "shortcodes/resources.html" (dict
  "page" .
  "sort" "asc"
)}}

Multilanguage features are not supported directly by the shortcode but rely on Hugo’s handling for resource translations applied when the theme iterates over all available resources.

Parameters

Name Default Notes
pageref <empty> A reference to the page bundle whose resources are listed, like /shortcodes/attachments or relative to the current page.

If set and it doesn’t resolve to a page, the build fails. If not set, the current page is used or, if called as partial, the page given in page.
style transparent The style scheme used for the box.

- by severity: caution, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code, link, action, inline

You can also define your own styles.
color see notes The CSS color value to be used. If not set, the chosen color depends on the style. Any given value will overwrite the default.

- for severity styles: a nice matching color for the severity
- for all other styles: the corresponding color
title see notes Arbitrary text for the box title. Depending on the style there may be a default title. Any given value will overwrite the default.

- for severity styles: the matching title for the severity
- for all other styles: Resources

If you want no title for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)
icon see notes Font Awesome icon name set to the left of the title. Depending on the style there may be a default icon. Any given value will overwrite the default.

- for severity styles: a nice matching icon for the severity
- for all other styles: paperclip

If you want no icon, you have to set this parameter to " " (a non empty string filled with spaces)
expanded <empty> Whether to draw an expander and how the resource list is displayed.

- <empty>: no expander is drawn and the resource list is permanently shown
- true: the expander is drawn and the resource list is initially shown
- false: the expander is drawn and the resource list is initially hidden
sort asc Sorting the output in ascending or descending order.
pattern .* A regular expressions, used to filter the resources by name. For example:

- to match a file suffix of ‘jpg’, use .*\.jpg (not *.\.jpg)
- to match file names ending in jpg or png, use .*\.(jpg|png)

Examples

Custom Title, List of Resources Ending in png, jpg or gif

​
{{% resources pattern=".*\.(png|jpg|gif)" title="Related **files**" /%}}
{{ partial "shortcodes/resources.html" (dict
  "page" .
  "pattern" ".*\\.(png|jpg|gif)"
  "title" "Related **files**"
)}}
Related files

Info Styled Box, Descending Sort Order

​
{{% resources sort="desc" style="info" /%}}
{{ partial "shortcodes/resources.html" (dict
  "page" .
  "sort" "desc"
  "style" "info"
)}}

With User-Defined Color and Font Awesome Brand Icon

​
{{% resources color="fuchsia" icon="fa-fw fab fa-hackerrank" /%}}
{{ partial "shortcodes/resources.html" (dict
  "page" .
  "color" "fuchsia"
  "icon" "fa-fw fab fa-hackerrank"
)}}
Attachments

Expander with Initially Hidden Resource List

​
{{% resources expanded="false" style="primary" /%}}
{{ partial "shortcodes/resources.html" (dict
  "page" .
  "expanded" "false"
  "style" "primary"
)}}
Attachments

Resources of Another Page

​
{{% resources pageref="/shortcodes/attachments" pattern=".*/hugo\..*" /%}}
{{ partial "shortcodes/resources.html" (dict
  "page" .
  "pageref" "/shortcodes/attachments"
  "pattern" ".*/hugo\\..*"
)}}

Style, Color, Title and Icons

For further examples for style, color, title and icon, see the callout shortcode documentation. The parameters are working the same way for both shortcodes, besides having different defaults.

SiteParam

The siteparam shortcode prints values of site-wide params contained in your hugo.toml.

This text comes from your configuration

Usage

​
{{% siteparam name="siteparam.test.greetings" %}}
{{% siteparam "siteparam.test.greetings" %}}
{{ partial "shortcodes/siteparam.html" (dict
  "page" .
  "name" "siteparam.test.greetings"
)}}

To print params from a page’s front matter and falling back to the site options, use Hugo’s built-in param shortcode.

Parameters

Name Position Default Notes
name 1 <empty> The name of the site param to be displayed.

Examples

editURL

​
`editURL` value: {{% siteparam name="editURL" %}}
`editURL` value: {{% siteparam "editURL" %}}
`editURL` value: {{ partial "shortcodes/siteparam.html" (dict
  "page" .
  "name" "editURL"
)}}
editURL value: https://github.com/McShelby/hugo-theme-relearn/edit/main/docs/content/${FilePath}

Nested Parameter with Markdown and HTML Formatting

To use formatted parameter, add this in your hugo.toml:

hugo.
[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true
markup:
  goldmark:
    renderer:
      unsafe: true
{
   "markup": {
      "goldmark": {
         "renderer": {
            "unsafe": true
         }
      }
   }
}

Now values containing Markdown will be formatted correctly.

hugo.
[params]
[siteparam]
  [siteparam.test]
    text = 'A **nested** parameter <b>with</b> formatting'
params: {}
siteparam:
  test:
    text: A **nested** parameter <b>with</b> formatting
{
   "params": {},
   "siteparam": {
      "test": {
         "text": "A **nested** parameter \u003cb\u003ewith\u003c/b\u003e formatting"
      }
   }
}
​
Formatted parameter: {{% siteparam name="siteparam.test.text" %}}
Formatted parameter: {{% siteparam "siteparam.test.text" %}}
Formatted parameter: {{ partial "shortcodes/siteparam.html" (dict
  "page" .
  "name" "siteparam.test.text"
)}}
Formatted parameter: A nested option <b>with</b> formatting

Tabs

The tabs shortcode displays arbitrary content in an unlimited number of tabs.

​
The AI native programming language.
echo "For guys who like to tinker."
For the connoisseur of programming.

Usage

​
{{< tabs >}}
{{% tab title="Python Saying" %}}The AI native programming language.{{% /tab %}}
{{% tab title="Terminal Sourcecode" %}}
```bash
echo "For guys who like to tinker."
```
{{% /tab %}}
{{% tab color="fuchsia" title="C Ramblings" %}}For the connoisseur of programming.{{% /tab %}}
{{% tab color="red" title="C++ Ramblings++" %}}For the guys that can cope with syntax.{{% /tab %}}
{{% tab title="C# ~~GC is cool~~" %}}For guys that need two destructors.{{% /tab %}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "The AI native programming language."
      "title" "Python Saying"
    )
    (dict
      "content" "```bash\necho \"For guys who like to tinker.\"\n```"
      "title" "Terminal Sourcecode"
    )
    (dict
      "color" "fuchsia"
      "content" "For the connoisseur of programming."
      "title" "C Ramblings"
    )
    (dict
      "color" "red"
      "content" "For the guys that can cope with syntax."
      "title" "C++ Ramblings++"
    )
    (dict
      "content" "For guys that need two destructors."
      "title" "C# ~~GC is cool~~"
    )
  )
)}}

Parameters

Name Default Notes
groupid <random> Arbitrary name of the group the tab view belongs to.

Tab views with the same groupid synchronize their selected tab. The tab selection is restored automatically based on the groupid for tab view. If the selected tab cannot be found in a tab group the first tab is selected instead.

This synchronization applies to the whole site!
style <empty> Sets a default value for every contained tab. Can be overridden by each tab. See the tab parameters for possible values.
color <empty> Sets a default value for every contained tab. Can be overridden by each tab. See the tab parameters for possible values.
title <empty> Arbitrary title written in front of the tab view.
icon <empty> Font Awesome icon name set to the left of the title.
<content> <empty> Arbitrary number of tabs defined with the tab sub-shortcode.

Tab Parameters

Each tab of the view is defined with the tab shortcode.

Name Default Notes
style see notes The style scheme used for the tab. If you don’t set a style and you display a single code block inside of the tab, its default styling will adapt to that of a code block. Otherwise default is used.

- by severity: caution, important, info, note, tip, warning
- by brand color: primary, secondary, accent
- by color: blue, cyan, green, grey, magenta, orange, red
- by special color: default, transparent, code, link, action, inline

You can also define your own styles.
color see notes The CSS color value to be used. If not set, the chosen color depends on the style. Any given value will overwrite the default.

- for severity styles: a nice matching color for the severity
- for all other styles: the corresponding color
title see notes Arbitrary title for the tab. Depending on the style there may be a default title. Any given value will overwrite the default.

- for severity styles: the matching title for the severity
- for all other styles: <empty>

If you want no title for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)
icon see notes Font Awesome icon name set to the left of the title. Depending on the style there may be a default icon. Any given value will overwrite the default.

- for severity styles: a nice matching icon for the severity
- for all other styles: <empty>

If you want no icon for a severity style, you have to set this parameter to " " (a non empty string filled with spaces)
hint <empty> Tooltip for the tab. A tab showing an icon but no title should have one, as it is what assistive technology announces for it.
<content> <empty> Arbitrary text to be displayed in the tab.

Single Tab

If you just want a single tab, you can call the tab shortcode standalone, without the enclosing tabs shortcode.

​
{{% tab title="c" %}}
```c
printf("Hello World!");
```
{{% /tab %}}
{{ partial "shortcodes/tab.html" (dict
  "page" .
  "content" "```c\nprintf(\"Hello World!\");\n```"
  "title" "c"
)}}
​
printf("Hello World!");

If you want further options when using a single code tab, you can also use the highlight shortcode.

Examples

Behavior of the groupid

See what happens to the tab views while you select different tabs.

While pressing a tab of Group A switches all tab views of Group A in sync (if the tab is available), the tabs of Group B are left untouched.

Note

The selected tab will be stored in the reader’s browser.

Group A, Tabs 1

​
{{< tabs groupid="tab-example-a" title="Group A, Tabs 1" >}}
{{% tab title="JSON" %}}
```json
{ "Hello": "World" }
```
{{% /tab %}}
{{% tab title="_**XML**_" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{% tab title="Text" %}}    World{{% /tab %}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "```json\n{ \"Hello\": \"World\" }\n```"
      "title" "JSON"
    )
    (dict
      "content" "```xml\n<Hello>World</Hello>\n```"
      "title" "_**XML**_"
    )
    (dict
      "content" "    World"
      "title" "Text"
    )
  )
  "groupid" "tab-example-a"
  "title" "Group A, Tabs 1"
)}}

Group A, Tabs 2

​
{{< tabs groupid="tab-example-a" title="Group A, Tabs 2" >}}
{{% tab title="JSON" %}}
```json
{ "Hello": "World" }
```
{{% /tab %}}
{{% tab title="XML" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "```json\n{ \"Hello\": \"World\" }\n```"
      "title" "JSON"
    )
    (dict
      "content" "```xml\n<Hello>World</Hello>\n```"
      "title" "XML"
    )
  )
  "groupid" "tab-example-a"
  "title" "Group A, Tabs 2"
)}}

Group B

​
{{< tabs groupid="tab-example-b" title="Group B" >}}
{{% tab title="JSON" %}}
```json
{ "Hello": "World" }
```
{{% /tab %}}
{{% tab title="XML" %}}
```xml
<Hello>World</Hello>
```
{{% /tab %}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "```json\n{ \"Hello\": \"World\" }\n```"
      "title" "JSON"
    )
    (dict
      "content" "```xml\n<Hello>World</Hello>\n```"
      "title" "XML"
    )
  )
  "groupid" "tab-example-b"
  "title" "Group B"
)}}

Rendered Example

Group A, Tabs 1
{ "Hello": "World" }
<Hello>World</Hello>
World
Group A, Tabs 2
{ "Hello": "World" }
<Hello>World</Hello>
Group B
{ "Hello": "World" }
<Hello>World</Hello>

Nested Tab Views and Color

In case you want to nest tab views, the parent tab that contains nested tab views needs to be declared with {{< tab >}} instead of {{% tab %}}. Note, that in this case it is not possible to put markdown in the parent tab.

You can also set style and color parameter for all tabs and overwrite them on tab level. See the tab parameters for possible values.

​
{{< tabs groupid="main" icon="thumbtack" style="primary" title="Rationale" >}}
{{< tab title="Text" >}}
  Simple text is possible here...
  {{< tabs groupid="tabs-example-language" >}}
  {{% tab title="python" %}}
  Python is **super** easy.
  
  - most of the time.
  - if you don't want to output unicode
  {{% /tab %}}
  {{% tab title="bash" %}}Bash is for **hackers**.{{% /tab %}}
  {{< /tabs >}}
{{< /tab >}}
{{< tab color="darkorchid" style="default" title="Code" >}}
  ...but no markdown
  {{< tabs groupid="tabs-example-language" >}}
  {{% tab title="python" %}}
  ```python
  print("Hello World!")
  ```
  {{% /tab %}}
  {{% tab title="bash" %}}
  ```bash
  echo "Hello World!"
  ```
  {{% /tab %}}
  {{< /tabs >}}
{{< /tab >}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "Simple text is possible here..."
      "content" (partial "shortcodes/tabs.html" (dict
        "page" .
        "content" (slice
          (dict
            "content" "Python is **super** easy.\n\n- most of the time.\n- if you don't want to output unicode"
            "title" "python"
          )
          (dict
            "content" "Bash is for **hackers**."
            "title" "bash"
          )
        )
        "groupid" "tabs-example-language"
      ))
      "title" "Text"
    )
    (dict
      "color" "darkorchid"
      "content" "...but no markdown"
      "content" (partial "shortcodes/tabs.html" (dict
        "page" .
        "content" (slice
          (dict
            "content" "```python\nprint(\"Hello World!\")\n```"
            "title" "python"
          )
          (dict
            "content" "```bash\necho \"Hello World!\"\n```"
            "title" "bash"
          )
        )
        "groupid" "tabs-example-language"
      ))
      "style" "default"
      "title" "Code"
    )
  )
  "groupid" "main"
  "icon" "thumbtack"
  "style" "primary"
  "title" "Rationale"
)}}
Rationale
​

Python is super easy.

  • most of the time.
  • if you don’t want to output unicode
Bash is for hackers.
​
print("Hello World!")
echo "Hello World!"

Single Code Block with Collapsed Margins

​
{{% tab title="Code" %}}
```python
printf("Hello World!");
```
{{% /tab %}}
{{ partial "shortcodes/tab.html" (dict
  "page" .
  "content" "```python\nprintf(\"Hello World!\");\n```"
  "title" "Code"
)}}
​
printf("Hello World!");

Mixed Markdown Content

​
{{% tab title="_**Mixed**_" %}}
A tab cannot only contain code but arbitrary text. In this case text **and** code will get a margin.
```python
printf("Hello World!");
```
{{% /tab %}}
{{ partial "shortcodes/tab.html" (dict
  "page" .
  "content" "A tab cannot only contain code but arbitrary text. In this case text **and** code will get a margin.\n```python\nprintf(\"Hello World!\");\n```"
  "title" "_**Mixed**_"
)}}
​

A tab cannot only contain code but arbitrary text. In this case text and code will get a margin.

printf("Hello World!");

Icon with Hint

A tab showing nothing but an icon needs a hint: it is shown as a tooltip and is what assistive technology announces for the tab.

​
{{< tabs >}}
{{% tab hint="Download" icon="download" %}}Get the theme from its repository.{{% /tab %}}
{{% tab hint="Configure" icon="gears" %}}Set the options in your `hugo.toml`.{{% /tab %}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "Get the theme from its repository."
      "hint" "Download"
      "icon" "download"
    )
    (dict
      "content" "Set the options in your `hugo.toml`."
      "hint" "Configure"
      "icon" "gears"
    )
  )
)}}
​
Get the theme from its repository.
Set the options in your hugo.toml.

Understanding style and color Behavior

The style parameter affects how the color parameter is applied.

​
{{< tabs >}}
{{% tab style="blue" title="just colored style" %}}
The `style` parameter is set to a color style.

This will set the background to a lighter version of the chosen style color as configured in your theme variant.
{{% /tab %}}
{{% tab color="blue" title="just color" %}}
Only the `color` parameter is set.

This will set the background to a lighter version of the chosen CSS color value.
{{% /tab %}}
{{% tab color="blue" style="default" title="default style and color" %}}
The `style` parameter affects how the `color` parameter is applied.

The `default` style will set the background to your `--MAIN-BG-color` as configured for your theme variant resembling the default style but with different color.
{{% /tab %}}
{{% tab style="info" title="just severity style" %}}
The `style` parameter is set to a severity style.

This will set the background to a lighter version of the chosen style color as configured in your theme variant and also affects the chosen icon.
{{% /tab %}}
{{% tab color="blue" style="info" title="severity style and color" %}}
The `style` parameter affects how the `color` parameter is applied.

This will set the background to a lighter version of the chosen CSS color value and also affects the chosen icon.
{{% /tab %}}
{{< /tabs >}}
{{ partial "shortcodes/tabs.html" (dict
  "page" .
  "content" (slice
    (dict
      "content" "The `style` parameter is set to a color style.\n\nThis will set the background to a lighter version of the chosen style color as configured in your theme variant."
      "style" "blue"
      "title" "just colored style"
    )
    (dict
      "color" "blue"
      "content" "Only the `color` parameter is set.\n\nThis will set the background to a lighter version of the chosen CSS color value."
      "title" "just color"
    )
    (dict
      "color" "blue"
      "content" "The `style` parameter affects how the `color` parameter is applied.\n\nThe `default` style will set the background to your `--MAIN-BG-color` as configured for your theme variant resembling the default style but with different color."
      "style" "default"
      "title" "default style and color"
    )
    (dict
      "content" "The `style` parameter is set to a severity style.\n\nThis will set the background to a lighter version of the chosen style color as configured in your theme variant and also affects the chosen icon."
      "style" "info"
      "title" "just severity style"
    )
    (dict
      "color" "blue"
      "content" "The `style` parameter affects how the `color` parameter is applied.\n\nThis will set the background to a lighter version of the chosen CSS color value and also affects the chosen icon."
      "style" "info"
      "title" "severity style and color"
    )
  )
)}}
​

The style parameter is set to a color style.

This will set the background to a lighter version of the chosen style color as configured in your theme variant.

Only the color parameter is set.

This will set the background to a lighter version of the chosen CSS color value.

The style parameter affects how the color parameter is applied.

The default style will set the background to your --MAIN-BG-color as configured for your theme variant resembling the default style but with different color.

The style parameter is set to a severity style.

This will set the background to a lighter version of the chosen style color as configured in your theme variant and also affects the chosen icon.

The style parameter affects how the color parameter is applied.

This will set the background to a lighter version of the chosen CSS color value and also affects the chosen icon.

Tree

The tree shortcode displays text as a tree with configurable icons and colors.

  • home

Usage

​
```tree
- home | folder
  - [.config](http://example.com) | folder
  - My Documents | folder | magic
    - home.php | fa-fw fab fa-php | #888cc4
```
{{% tree %}}
- home | folder
  - [.config](http://example.com) | folder
  - My Documents | folder | magic
    - home.php | fa-fw fab fa-php | #888cc4
{{% /tree %}}
{{ partial "shortcodes/tree.html" (dict
  "page" .
  "content" "- home | folder\r\n  - [.config](http://example.com) | folder\r\n  - My Documents | folder | magic\r\n    - home.php | fa-fw fab fa-php | #888cc4"
)}}

Markdown codefence syntax is widely available in other Markdown parsers like GitHub and therefore is the recommended syntax for generating portable Markdown.

Parameters

Name Default Notes
<content> <empty> Your list as Markdown or from your favorite tree commandline tool.

Item Syntax

<NAME> [ | <ICON> [ | <COLOR> ] ]

The NAME can be followed by an optional pipe (|) to define an ICON and further optional pipe to define the icon’s COLOR.

  • ICON: Font Awesome icon name set to the left of the NAME. If you give a single string, it is selected from Font Awesome’s solid icons. If you want to use a different set, you have to give the complete styles. See above example for the home.php.

  • COLOR: The CSS color value to be used. If not set, the primary color will be used.

    You can also set a style value known from other shortcodes.

    • by severity: caution, important, info, note, tip, warning
    • by brand color: primary, secondary, accent
    • by color: blue, cyan, green, grey, magenta, orange, red
    • by special color: default, transparent, code, link, action, inline
    • you can also define your own styles.

    If a style and a named HTML color have the same name, the style color will be used.

Examples

tree Command Output

Use the tree command of your favorite operating system and dump it right into the shortcode. Note, that the directory marker (here C:.) is removed if present.

​
```tree
C:.
│   featured.png
│   index.en.md
│   index.pir.md
│   MaybeTreasure.en.txt
│   MaybeTreasure.pir.txt
│   NoTreasure.en.txt
│   Treasure.pir.txt
│
└───subdir
        hugo.png
```
{{% tree %}}
C:.
│   featured.png
│   index.en.md
│   index.pir.md
│   MaybeTreasure.en.txt
│   MaybeTreasure.pir.txt
│   NoTreasure.en.txt
│   Treasure.pir.txt
│
└───subdir
        hugo.png
{{% /tree %}}
{{ partial "shortcodes/tree.html" (dict
  "page" .
  "content" "C:.\r\n│   featured.png\r\n│   index.en.md\r\n│   index.pir.md\r\n│   MaybeTreasure.en.txt\r\n│   MaybeTreasure.pir.txt\r\n│   NoTreasure.en.txt\r\n│   Treasure.pir.txt\r\n│\r\n└───subdir\r\n        hugo.png"
)}}
  • featured.png
  • index.en.md
  • index.pir.md
  • MaybeTreasure.en.txt
  • MaybeTreasure.pir.txt
  • NoTreasure.en.txt
  • Treasure.pir.txt
  • subdir
    • hugo.png

Markdown List with Styled Items

Every possible combination

​
```tree
- just names
  - Document
  - My Document
  - [My linked Document](http://example.com)
- simple icons | folder
  - Document | file
  - My Document | file
- mindblowing icons
  - index.md | fa-fw fab fa-markdown
  - index.html | fa-fw fab fa-html5
- and now with color
  - script.php | fa-fw fab fa-php | purple
  - alt script.php | fa-fw fab fa-php | #888cc4
  - magic.php | fa-fw fab fa-php | magic
```
{{% tree %}}
- just names
  - Document
  - My Document
  - [My linked Document](http://example.com)
- simple icons | folder
  - Document | file
  - My Document | file
- mindblowing icons
  - index.md | fa-fw fab fa-markdown
  - index.html | fa-fw fab fa-html5
- and now with color
  - script.php | fa-fw fab fa-php | purple
  - alt script.php | fa-fw fab fa-php | #888cc4
  - magic.php | fa-fw fab fa-php | magic
{{% /tree %}}
{{ partial "shortcodes/tree.html" (dict
  "page" .
  "content" "- just names\r\n  - Document\r\n  - My Document\r\n  - [My linked Document](http://example.com)\r\n- simple icons | folder\r\n  - Document | file\r\n  - My Document | file\r\n- mindblowing icons\r\n  - index.md | fa-fw fab fa-markdown\r\n  - index.html | fa-fw fab fa-html5\r\n- and now with color\r\n  - script.php | fa-fw fab fa-php | purple\r\n  - alt script.php | fa-fw fab fa-php | #888cc4\r\n  - magic.php | fa-fw fab fa-php | magic"
)}}
  • just names
  • simple icons
    • Document
    • My Document
  • mindblowing icons
    • index.md
    • index.html
  • and now with color
    • script.php
    • alt script.php
    • magic.php