30 lines
787 B
HTML
30 lines
787 B
HTML
{{ $slug := .Page.Slug }}
|
|
{{ $galleryName := .Get "name" }}
|
|
{{ $file := printf "%s.yaml" $galleryName }}
|
|
{{ $galleryData := .Page.Resources.GetMatch $file | transform.Unmarshal }}
|
|
|
|
<div class="gallery gallery-new">
|
|
{{ range $galleryData.images }}
|
|
{{ $imageURL := printf "%s/%s/%s" site.Params.filesBase $slug .src }}
|
|
|
|
<figure class="{{ .class | default "" }}">
|
|
<a
|
|
class="lightgallery"
|
|
href="{{ $imageURL }}"
|
|
data-thumbnail="{{ $imageURL }}"
|
|
{{ with .caption }}data-sub-html="{{ . }}"{{ end }}>
|
|
<img
|
|
src="{{ $imageURL }}"
|
|
alt="{{ .alt | default "" }}"
|
|
loading="lazy"
|
|
decoding="async" />
|
|
</a>
|
|
{{ with .caption }}
|
|
<figcaption>{{ . }}</figcaption>
|
|
{{ end }}
|
|
</figure>
|
|
|
|
|
|
{{ end }}
|
|
</div>
|