Files
caldwell/layouts/partials/gallery/list.html
2025-09-13 23:23:17 +00:00

42 lines
1.4 KiB
HTML

<div class="gallery masonry lightbox">
<div class="grid-sizer"></div>
{{ range sort .Pages "Date" "desc" }}
{{ if not .Params.private }}
{{ $hero := partial "components/hero/process.html" .Params.hero }}
{{ if $hero.src }}
{{ $data := partial "components/image/process.html" (dict "page" . "src" $hero.src) }}
{{- $caption := .Title -}}
{{- $title := $hero.title | default $caption | plainify -}}
{{- $alt := $hero.alt | default $title | plainify -}}
<div class="image grid-item">
<a
href="{{- .RelPermalink -}}"
data-pswp-src="{{- $data.full.RelPermalink -}}"
data-pswp-width="{{- $data.full.Width -}}"
data-pswp-height="{{- $data.full.Height -}}"
class="pswp-image"
>
<img
src="{{- $data.thumb.RelPermalink -}}"
width="{{- $data.thumb.Width -}}"
height="{{- $data.thumb.Height -}}"
loading="lazy"
{{ with $title }}title="{{- . -}}"{{ end }}
{{ with $alt }}alt="{{- . -}}"{{ end }}
/>
</a>
<div class="pswp-caption-content">
<div>
<a href="{{- .RelPermalink -}}">{{ $caption }}</a>
{{ partial "components/meta/index.html" . }}
</div>
</div>
</div>
{{ end }}
{{ end }}
{{ end }}
</div>