短代碼例子

在編寫短代碼的文檔時,我們通常會提供示例及其源代碼,以便用戶可以預覽結果、閱讀和複製代碼,而這將需要你重複相似的代碼兩次。有了這個短代碼,你僅需鍵入一次源代碼則可以實現這一點。

本頁內容

語法

1{{< hugo/shortcode-example >}}
2轉義後的源代碼
3{{< /hugo/shortcode-example >}}

示例

param 為例。

1{{< hugo/shortcode-example >}}
2Title: {{</* param title */>}}
3{{< /hugo/shortcode-example >}}

Result as follows.

1Title: {{< param title >}}
Title: 短代碼例子