gcg-website/layouts/shortcodes/gallery.html
Denys Konovalov 7818a47100
All checks were successful
website-main / prod-build (push) Successful in 2m17s
website-main / test-build (push) Successful in 1m10s
website-main / auto-rebuild (push) Has been skipped
WIP: GCG35
2023-09-20 17:04:50 +02:00

19 lines
648 B
HTML

<div class="row">
{{ $dir := trim (.Get "dir") "/" }}
{{ with $dir }}
{{ $files := readDir (print "/static/" .) }}
{{ range $files }}
{{ $isimg := lower .Name | findRE "\\.(gif|jpg|jpeg|tiff|png|bmp|webp|avif|jxl)" }}
{{ if $isimg }}
{{ $linkURL := print (trim $.Site.BaseURL "/") "/" $dir "/" .Name | absURL }}
<div class="col-lg-3 col-md-4 col-sm-6">
<a class="vb-gallery" data-gall="{{ md5 $dir }}" href="{{ $linkURL }}">
<div class="ratio ratio-4x3">
<img class="lazy img-thumbnail w-100 object-cover" data-src="{{ $linkURL }}">
</div>
</a>
</div>
{{ end }}
{{ end }}
{{ end }}
</div>