How To Escape Shortcode In Hugo Template

Jul 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{{< highlight python >}}  if hello = True:    print "World"{{< /highlight >}}# Output: Successfully escaped{{</* highlight python */>}}  if hello = True:    print "World"{{</* /highlight */>}}

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.