The code below creates SEVENTEEN loading=eager, including those coming from the template itself. By the way, it’s not explicited in the version note. In the sourcecode of that page, about 10
{{if .IsBlock}}<figure {{else}}<span{{end}}
class="image flex flex-col right {{with .Attributes.class}}{{.}}{{end}}">
{{ with .Title }}<figcaption>{{.|markdownify}}</figcaption>{{ end }}
<a href="{{ .Destination | safeURL }}" target="_blank">
<img loading={{ if gt .Ordinal 7 }}"lazy"{{ else }}"eager"{{ end }}
src="{{ .Destination | safeURL }}.small" alt="{{ default .Title .Text }}"
{{ with .Title }}title="{{ . }}" {{ end }}/></a>
{{if .IsBlock}}</figure>{{else}}</span>{{end}}
The condition seems to target images at random without rhymn nor reason, I tried switching eager/lazy and .Ordinal/7, or increase/decrease the number, that does change the result somehow but not with any pattern I can recognize.
I tried with that:
<img loading={{ if gt .Ordinal 0 }}
and it scatter lazy and eager absolutely randomly all over the file.
I also noticed that anything inside that shortcode is ignored:
Your image render hook (it is not a shortcode) generates invalid HTML. You cannot place a figcaption element inside of anything but a figure element. Please learn to run your rendered HTML through a validator.
When I use your render hook, a markdown file with 10 images is rendered with only 2 images marked as “lazy”, which is the expected result (the .Ordinal begins at zero).
No, it does not.
If you need additional assistance, post a link to the public repository for your project.
And now, does it build ?
I should thank you, I could make an extremely instructive sample repository, something I struggled before.
I listened to your advice regards to figcaption too. I just wanted to keep the semantic aspect, and didn’t know it was forbidden inside a … I didn’t know it was a block level element.
I changed to the extended version, which canceled a lot of the weird ßë‘ßë happening, but not for this .Ordinal issue though.
I still see the count for .Ordinal is reset when inside a shortcode, even the markup calls for pictures  comes from the file.