Getting a list from within a shortcode

I have a suggestion. What about using split?

So your shortcode could be something like:

{{ .Get "name" | markdownify }}
{{ $aliases := split (.Get "aliases") "," }}

<ul>
  {{ range $aliases }}
    <li>{{ . }}</li>
  {{ end }}
</ul>

And be used like:

{{< shortcode 
      name="Peter Parker"
      aliases="Spiderman,Petey">}}
1 Like