I’m trying to do some math from a nested shortcode. My code looks like
{{ with .Parent }}
{{ $blocks := (div 12 (.Get "columns")) }}
<div class = 'column col-lg-{{ with $blocks }}{{ . }}{{ else }}12{{ end }}'>
{{ .Inner }}
</div>
{{ end }}
The columns
value would be from the parent shortcode. My code fails so far because the input value of columns
is a string. I would like to convert it into a float that would be work with the division operation.