Div
A Hugo shortcode to wrap elements in a div and apply specific classes or a style property to it. Useful as a building block.
# file.md
# div.html
# new_tab_link.html
<div
{{- if .IsNamedParams -}}
{{ if .Get `class` }} class="{{ .Get `class` }}"{{ end }}
{{ if .Get `style` }} style="{{ .Get `style` }}"{{ end }}
{{- else -}}
{{ if .Get 0 }} class="{{ .Get 0 }}"{{ end }}
{{- end -}}>
{{ .Inner | markdownify }}
</div>
💁
Note: according to original author Jim Frenette:
style parameter: since the semicolon declaration separator
;
is not permitted, only one declaration allowed
markdown
markdown