Shortcodes Reference

A definitive reference of all shortcodes available for use in Layer5 Academy content, including those provided by the Academy theme, Docsy, and Hugo.

The Layer5 Academy platform supports a wide range of shortcodes for enriching your learning content. Shortcodes are reusable template snippets you invoke in Markdown files to generate HTML output. They come from three sources:

  1. Academy Theme β€” custom shortcodes built specifically for the Academy platform.
  2. Docsy Theme β€” shortcodes inherited from the Google Docsy documentation theme.
  3. Hugo Built-in β€” shortcodes included with the Hugo static site generator.

For guidance on creating your own shortcodes, see Extending the Academy.

These shortcodes are defined in the academy-theme repository and are purpose-built for Academy content.

Displays styled alert boxes for important information. Supports multiple visual types.

Parameters:

ParameterDefaultDescription
type(none)Alert style: danger, info, warning, or note.
colorprimaryBootstrap color class (used when type is not set): danger, warning, info, primary, etc.
titleAuto-set from typeHeading text displayed in the alert.

Usage:

{{< alert type="info" title="Heads Up" >}}
This content supports **Markdown** formatting.
{{< /alert >}}
{{< alert type="warning" >}}
Proceed with caution.
{{< /alert >}}
{{< alert color="danger" title="Critical" >}}
This uses the color parameter instead of type.
{{< /alert >}}

Wraps content in a styled chapter container. Useful for applying custom CSS to a section of content.

Parameters:

ParameterDefaultDescription
style(none)Inline CSS style string applied to the container.

Usage:

{{< chapterstyle style="background: #f5f5f5; padding: 1rem;" >}}
Your styled content here.
{{< /chapterstyle >}}

Creates a collapsible accordion block using the HTML <details> element.

Parameters:

ParameterDefaultDescription
summary(required)Title text shown in the clickable summary bar.
openfalseSet to "true" to expand the block by default.

Usage:

{{< details summary="Click to expand" >}}
Hidden content revealed on click. Supports **Markdown**.
{{< /details >}}
{{< details summary="Open by default" open="true" >}}
This section starts expanded.
{{< /details >}}

Displays an image with optional caption, alignment, sizing, and click-to-expand modal behavior.

Parameters:

ParameterDefaultDescription
src(required)Image source URL or relative path.
width100%CSS width value.
aligncenterText alignment: left, center, or right.
alt""Alt text for accessibility.
title""Caption displayed below the image.
radius0%CSS border-radius value.

Usage:

{{< image src="./images/diagram.png" alt="Architecture diagram" title="System Overview" width="80%" radius="8px" >}}

Embeds an HTML5 video player with playback controls.

Parameters:

ParameterDefaultDescription
src(required)Video file URL or relative path.
muted(flag)Mutes the video when present.
autoplay(flag)Autoplays the video when present.
loop(flag)Loops the video when present.

Usage:

{{< local-video src="./videos/demo.mp4" autoplay muted loop >}}

Embeds an interactive Kanvas design visualization into the page.

Parameters:

ParameterDefaultDescription
src(required)Path to the generated embed JavaScript file.
id(required)Unique embed ID (typically embedded-design-{designId}).
sizefullContainer size: full (80% width) or half (50% width).
style(none)Custom inline CSS (overrides size).
hosthttps://cloud.layer5.ioRemote provider hostname.
showOpenLinktrueWhether to show the “Open Design” link.

Usage:

{{< meshery-design-embed src="./embed.js" id="embedded-design-abc123" size="full" >}}

Creates a styled information box.

Parameters:

ParameterDefaultDescription
colorprimaryColor class for styling.

Usage:

{{< pageinfo color="info" >}}
General information about this section.
{{< /pageinfo >}}

Loads and inlines an SVG file from the theme’s assets/icons/ directory.

Parameters:

ParameterDefaultDescription
name(required)SVG filename without the .svg extension.

Usage:

{{< svg name="logo" >}}

Displays a colored text span, typically used for version identifiers.

Parameters:

ParameterDefaultDescription
color(required)CSS color value for the text.

Usage:

{{< version color="green" >}}v2.1.0{{< /version >}}

Stores inner content as a lab introduction for use by the lab page template. This shortcode does not render output directly; instead, it passes content to the rendering pipeline.

Usage:

{{< lab-intro >}}
Welcome to this hands-on lab. You will learn to deploy a microservice.
{{< /lab-intro >}}

Generates a permissions table from a CSV data file, grouped by category. Reads from static/data/csv/keys-backup.csv. Used internally for permissions documentation.

Parameters: None.

Generates a role-based permissions table from a CSV data file. Filters and groups data by role type and links to relevant role documentation pages. Used internally for roles documentation.

Parameters: None.

Resolves the path to a static asset within the current tenant’s UUID scope.

Parameters:

ParameterDefaultDescription
(positional)(required)Path to the static asset.

Usage:

{{< usestatic "images/logo.png" >}}

Output: /{tenant-uuid}/images/logo.png

These shortcodes are provided by the Docsy theme. The Academy theme inherits them through Hugo module imports. For full details, see the Docsy shortcodes documentation.

Creates tabbed content panels. Tabs can contain text or code blocks.

Parameters (tabpane):

ParameterDefaultDescription
textfalseSet to true for text content (disables code highlighting).
langEqualsHeaderfalseUse tab header as the code language.
persistLangtrueRemember selected tab across page loads.
rightfalseRight-align tabs.

Parameters (tab):

ParameterDefaultDescription
name(required)Tab header text.
codelang""Language for syntax highlighting.
disabledfalseDisables the tab.

Usage:

{{< tabpane text=true >}}
{{< tab name="Linux" >}}
Run: `sudo apt install meshery`
{{< /tab >}}
{{< tab name="macOS" >}}
Run: `brew install meshery`
{{< /tab >}}
{{< /tabpane >}}

Displays content in Bootstrap-style cards. Use cardpane to group multiple cards.

Parameters (card):

ParameterDefaultDescription
header(none)Card header text.
title(none)Card title.
subtitle(none)Card subtitle.
footer(none)Card footer text.
codefalseSet to true to enable syntax highlighting for inner content.

Usage:

{{< cardpane >}}
{{< card header="Step 1" >}}
Install the prerequisites.
{{< /card >}}
{{< card header="Step 2" >}}
Configure your environment.
{{< /card >}}
{{< /cardpane >}}

Reads and displays the contents of an external file, with optional syntax highlighting.

Parameters:

ParameterDefaultDescription
file(required)Path to the file (relative to the page or site root).
codetrueWrap output in a code block.
lang""Language for syntax highlighting.

Usage:

{{< readfile file="config.yaml" code=true lang="yaml" >}}

Processes images using Hugo’s built-in image pipeline (resize, crop, fit, fill).

Parameters:

ParameterDefaultDescription
(positional 1)(required)Image filename (page resource).
(positional 2)(required)Processing command: Resize, Fit, Fill, or Crop.
(positional 3)(required)Processing options (e.g., 400x400).

Usage:

{{< imgproc "hero.jpg" Resize "800x" >}}
Optional caption text.
{{< /imgproc >}}

Embeds external content via an iframe with configurable options.

Parameters:

ParameterDefaultDescription
src(required)URL to embed.
width100%Iframe width.
tryautoheighttrueAttempt to auto-size the iframe height.
sandbox""Sandbox attribute for security restrictions.

Usage:

{{< iframe src="https://example.com/embed" width="100%" >}}

Embeds a Swagger UI instance for interactive API documentation.

Parameters:

ParameterDefaultDescription
src(required)Path to the OpenAPI/Swagger JSON or YAML spec file.

Usage:

{{< swaggerui src="/api/openapi.yaml" >}}

Renders API documentation using ReDoc.

Parameters:

ParameterDefaultDescription
src(required)URL or path to the OpenAPI spec file.

Usage:

{{< redoc src="/api/openapi.yaml" >}}

Comments out a block of content so it is not rendered in the output.

Usage:

{{< comment >}}
This content will not appear in the rendered page.
{{< /comment >}}

Shows or hides content based on a build condition defined in the site configuration.

Parameters:

ParameterDefaultDescription
include-if(required)Condition name from site config to evaluate.

Usage:

{{< conditional-text include-if="defined-condition" >}}
This text only appears when the condition is met.
{{< /conditional-text >}}

Creates a full-width page section with optional color and height.

Parameters:

ParameterDefaultDescription
color(none)Section background color: primary, secondary, info, warning, danger, light, dark, white.
height(none)Section height: auto, min, med, max, full.
typesectionSection type.

Creates a lead paragraph section for introductory content.

Parameters:

ParameterDefaultDescription
color(none)Background color.
heightautoSection height.

Creates a cover/hero section with a background image.

Parameters:

ParameterDefaultDescription
image_anchorsmartImage crop anchor point.
height(none)Section height: auto, min, med, max, full.
color(none)Overlay color.
title(none)Cover title.
subtitle(none)Cover subtitle.
logo(none)Path to a logo image.
byline(none)Byline text.

Creates a feature highlight box with an icon, typically used in groups of three.

Parameters:

ParameterDefaultDescription
title(required)Feature title.
url(none)Link URL.
url_text(none)Link text.
icon(none)Font Awesome icon name (e.g., fa-cogs).

Creates a downward navigation arrow that scrolls to the next section. Must be nested inside another block shortcode.

Parameters: None.

These shortcodes are included with Hugo itself and are always available. For full details, see the Hugo shortcodes documentation.

Renders an HTML <figure> element with an image and optional caption, link, and attributes.

Parameters:

ParameterDescription
srcImage URL.
linkURL the image links to.
targetLink target attribute.
relLink rel attribute.
altAlt text.
titleImage title.
captionFigure caption (supports Markdown).
classCSS class for the <figure> element.
heightImage height.
widthImage width.
attrAttribution text.
attrlinkAttribution link URL.

Usage:

{{< figure src="./images/overview.png" title="System Architecture" caption="High-level view of the platform." >}}

Embeds a GitHub Gist.

Parameters:

ParameterDescription
(positional 1)GitHub username.
(positional 2)Gist ID.
(positional 3)(optional) Filename to display from a multi-file gist.

Usage:

{{< gist "username" "gist-id" >}}

Renders code with syntax highlighting. Equivalent to fenced code blocks but with more control.

Parameters:

ParameterDescription
(positional 1)Language for syntax highlighting.
linenosShow line numbers (true, false, table, inline).
hl_linesLines to highlight (e.g., "3-5 8").
linenostartStarting line number.

Usage:

{{< highlight go "linenos=table,hl_lines=3" >}}
func main() {
    fmt.Println("Hello")
    fmt.Println("Highlighted line")
}
{{< /highlight >}}

Outputs a site or page parameter value.

Usage:

{{< param "description" >}}

Creates absolute (ref) or relative (relref) permalinks to other pages.

Usage:

[Link text]({{< ref "/cloud/academy" >}})
[Relative link]({{< relref "extending-the-academy" >}})

Embeds a YouTube video.

Parameters:

ParameterDescription
(positional 1) or idYouTube video ID.
titleAccessible title for the iframe.
loadingLoading behavior (eager or lazy).

Usage:

{{< youtube "dQw4w9WgXcQ" >}}

Embeds a Vimeo video.

Parameters:

ParameterDescription
(positional 1) or idVimeo video ID.
titleAccessible title for the iframe.

Usage:

{{< vimeo "12345678" >}}
Last modified March 31, 2026: relocate (2c7d7fac)