How to read directory and list files that starts with .Page.Title-model

I have in folder: /static/images/

aaa-aaa-model1.png
aaa-aaa-model3.png
aaa-aaa-model4.png
aaa-aaa-model2.png

and i need this output:

aaa-aaa-model1.png
aaa-aaa-model2.png
aaa-aaa-model3.png
aaa-aaa-model4.png

So as you can see it needs to read .Page.Title (this is in example value: aaa-aaa) and need to order output by numbers that ends at the end of -model string (1…4).

This i need for my gallery slideshow to show images in order by filename numbers that begins with .Page.Title

Here is my try but i got error: ```
: wrong number of args for hasPrefix: want 2 got 3



{{ range (readDir “/static/images/”) }}
{{ if hasPrefix .Name “%s-model” .Page.Title }}


{{ end }}


also can readDir accept to scan only by .Page.Title so that i can remove if syntax and code to run faster?

I fix the solution using this code:

{{ if .IsNamedParams }}
<div class="fotorama" data-nav="thumbs" data-autoplay="true" data-keyboard="true" data-allowfullscreen="true">
  {{- $pageTitle := replace (lower .Page.Title) " " "-" -}}
  {{ range (readDir "/static/images/") }}
  {{ if (hasPrefix .Name ( printf "%s-model" $pageTitle )) }}
    <img src={{ printf "/images/%s" .Name }} />
  {{ end }}
  {{ end }}
</div>
{{ else }}
<div class="fotorama" data-nav="thumbs" data-autoplay="true" data-keyboard="true" data-allowfullscreen="true">
    <img src={{.Get 0}} />
</div>
{{ end }}