在代码块中显示 Shortcode 原文

如果不使用特殊方法,代码块中的 Shortcode 也会被 Hugo 渲染成 HTML。

参考:How is the Hugo Doc site showing shortcodes in code blocks?

使用 /**/,即可实现:

↓↓↓

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{{< kroki type="actdiag" >}}
{
  write -> convert -> image

  lane user {
    label = "User"
    write [label = "Writing reST"];
    image [label = "Get diagram IMAGE"];
  }
  lane actdiag {
    convert [label = "Convert reST to Image"];
  }
}
{{< /kroki >}}

Enter any child page of Series.

CTRL-/