23 lines
621 B
HTML
23 lines
621 B
HTML
{{ $slug := .Page.Slug }}
|
|
{{ $galleryName := .Get "name" }}
|
|
{{ $file := printf "%s.yaml" $galleryName }}
|
|
{{ $galleryData := .Page.Resources.GetMatch $file | transform.Unmarshal }}
|
|
|
|
<div class="gallery grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
|
|
{{ range $galleryData.images }}
|
|
|
|
<figure class="{{ .class | default "" }}">
|
|
<img
|
|
src="{{ site.Params.filesBase }}/{{ $slug }}/{{ .src }}"
|
|
alt="{{ .alt | default "" }}"
|
|
loading="lazy"
|
|
decoding="async" />
|
|
{{ with .caption }}
|
|
<figcaption>{{ . }}</figcaption>
|
|
{{ end }}
|
|
</figure>
|
|
|
|
|
|
{{ end }}
|
|
</div>
|