Use {{}} in shortcode

Problems with referencing React in Hugo.
I need in shortcode

<script type="text/babel">
  <div style={{ margin: '16px 0' }} /></div>
</script>

But there was a mistake.
Hugo has parsed {{}}, how can I avoid this.

To my knowledge, you can’t get around the delimiters that Golang uses for templating (i.e {{}}).

Just do a workaround:

<script>
var divStyle = {
  margin: '16px 0'
}
</script>
<script type="text/babel">
  <div style={divStyle} /></div>
</script>

This should work.

2 Likes

Thank you very much