From f03421274f12e3e5f7d24646184326326c6d45c1 Mon Sep 17 00:00:00 2001 From: Darius Lupsa Date: Sat, 8 May 2021 00:16:51 +0300 Subject: [PATCH] docs: Escaping Hugo/GO template code Short example how to escape Hugo/GO template code used in a highlight shortcode. Fixes: #1422 --- .../en/content-management/syntax-highlighting.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/content/en/content-management/syntax-highlighting.md b/content/en/content-management/syntax-highlighting.md index 8ff270c54..5195b8211 100644 --- a/content/en/content-management/syntax-highlighting.md +++ b/content/en/content-management/syntax-highlighting.md @@ -80,6 +80,20 @@ func GetTitleFunc(style string) func(s string) string { } {{< / highlight >}} +## Highlight Hugo/GO Template Code + +For highlighting Hugo/GO template code on your page, add `/*` after the opening double curly braces and `*/` before closing curly braces. + +``` go +{{}} +``` + +Gives this: + +``` go +{{}} +``` + ## Highlight Template Func See [Highlight](/functions/highlight/).