hugohugo-shortcode

Prevent parsing of shortcodes inside code blocks


I want to write a tutorial about Hugo, so I write a shortcode syntax in markdown, but I don't want to render it; I want it as normal text.

{{< ref "/page/about" >}}

When I run hugo server, it shows me: page not found, so obviously, it treats it as a shortcode.

How can I fix it?


Solution

  • You only need to adds /* */ in your shortcode and down. For example,

    {{</* ref "/page/about" */>}}