Hi I am working on a custom shortcode that I want to use to create an accordion/dropdown block. The shortcode works except for one parm that is not being rendered. I followed the instructions from the Create Your Own Shortcodes Documentation. Please note that I am using hugo 0.40.3.
the parm that is not rendering is:
<div id="collapse1" class="panel-collapse collapse {.Get
`col`}">
Which tells the accordion to start collapsed.
Here is the shortcode tag itself:
{{% accordion title="test" col="in" %}}
this is a test description
{{% /accordion %}}
Here is the shortcode file:
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse1">{{ .Get "title" }}</a>
</h2>
</div>
{{- if .Get "col"}}
<div id="collapse1" class="panel-collapse collapse {.Get `col`}">
<div class="panel-body"><p>{{ .Inner | markdownify }}</p></div>
</div>
{{- else}}
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body"><p>{{ .Inner | markdownify }}</p></div>
</div>
{{- end -}}
</div>
</div>