How To Escape Shortcode In Hugo Template

July 25, 2017

Markdown Syntax to escape Hugo shortcode

Show the shortcode as it is as output without executing the shortcode

{{</* highlight python */>}}
  if hello = True:
    print “World”
{{</* /highlight */>}}

Sample output

---
title: "How To Escape Shortcode In Hugo"
date: 2017-07-25T23:22:52+08:00
---

# Output: Failed to escape
  if hello = True:
    print "World"
# Output: Successfully escaped {{< highlight python >}} if hello = True: print "World" {{< /highlight >}}
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.