Enable Raw Html in Hugo

Enable support of raw html

Hugo disables html element rendering by default, we need to enable it.

Enable for an entire site

Add below in the config file

unsafe= true

Enable for a single page

  • Create layout/shortcodes/unsafe.html with the following content: {{ .Inner }}

  • In the markdown page, use it like this,

    {{< unsafe >}}
        <li>First item</li>
        <li>Second item
        <li>Third item</li>
    {{< /unsafe >}}

    above will be rendered like this,

    • First item
    • Second item
    • Third item