Having trouble using shortcode parameter

Here’s what I’m trying to do:

{{ range (readDir “./static/{{.Get 0}}”) }}
do stuff
{{ end }}

It doesn’t actually work but I think you get the idea of what I’m attempting. I’m totally unfamiliar with Go and Go templates, so I’d appreciate any suggestions on how to do this.

Try something like this:

$dir := (printf "/static/%s" (.Get 0) )
{{ range (readDir  $dir) }}
    do stuff
{{ end }}

That works. Just had to put those curly braces around the $dir line. Thanks for the help.

@e85Hc For my own education, would you mind telling me the desired/actual output and use for this was?

I was using shortcode to insert an image gallery.

The shortcode looks like {{% gallery folderName rowHeight %}}

So basically I put a bunch of images in a folder, I supply the folder name in the shortcode and the template constructs the image gallery regardless of how many images there are.