mad used my option 😊
I don't want an extra variable, what i said in my post above, but i develop the code more readable, using the 'snippet' statement, and can used on several places in my code, works like a sharm 🤩:
<@ snippet firstImage @>
<@~ filelist { glob: @{ files | def('*-1.jpg') } } ~@>
<@~ if @{ :filelistCount } = 0 ~@>
/shared/no-picture.png
<@~ else ~@>
<@ foreach in filelist @>@{ :file }<@ end @>
<@~ end ~@>
<@ end @>
<meta name="twitter:image" content="<@ firstImage @>">
I know there is a nice Extension about Meta-tags, will give it a try!