Update gallery page

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-09-13 21:36:59 +00:00
parent 9905066046
commit 08b8041c43
8 changed files with 102 additions and 98 deletions

View File

@@ -2,38 +2,38 @@
<div class="grid-sizer"></div>
{{ range sort .Pages "Date" "desc" }}
{{ if not .Params.private }}
{{ $page := . }}
{{ $imageData := partial "components/image/reflect.html" .Params.hero }}
{{ with $imageData.image }}
<div class="image grid-item">
<a
href="{{- $page.RelPermalink -}}"
data-pswp-src="{{- .RelPermalink -}}"
data-pswp-width="{{- .Width -}}"
data-pswp-height="{{- .Height -}}"
class="pswp-image"
>
<img
src="{{- .RelPermalink -}}"
width="{{- .Width -}}"
height="{{- .Height -}}"
loading="lazy"
{{ with $imageData.title }}title="{{- . -}}"{{ end }}
{{ with $imageData.alt }}alt="{{- . -}}"{{ end }}
/>
</a>
<div class="pswp-caption-content">
<div>
{{ upper $page.Title }}
<div class="meta">
{{ $page.Date | time.Format ":date_medium" }}
&middot;
<a href="{{- $page.RelPermalink -}}">View Post</a>
</div>
</div>
{{ $hero := partial "components/hero/process.html" .Params.hero }}
{{ $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>
{{ end }}
</div>
{{ end }}
{{ end }}
</div>