marzipano/layouts/shortcodes/gallery.html

19 lines
693 B
HTML
Raw Permalink Normal View History

2024-10-02 20:01:42 +02:00
<div class="shortcode 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="img-thumbnail w-100 object-cover" src="{{ $linkURL }}">
</div>
</a>
</div>
{{ end }}
{{ end }}
{{ end }}
</div>