{{- define "page-background" -}} {{- with .Params.background -}} {{- end -}} {{- end -}} {{- define "main" -}}
{{- with index .Params.categories 0 -}} {{- end -}} {{- with .Params.categories -}}
{{- range . -}} {{ . }} {{- end -}}
{{- end -}}

{{- .Title -}}

{{- with .Description -}}

{{ . }}

{{- end -}} {{- with .Params.author -}} {{- $authorPage := site.GetPage (printf "authors/%s" .) -}} {{- with $authorPage -}} {{- partial "author-card.html" . -}} {{- end -}} {{- end -}}
{{- $imgCount := len (.Resources.Match "[0-9]*.png") -}} {{- $itemCount := $imgCount -}} {{- if and (eq $imgCount 0) .Params.items -}}{{- $itemCount = len .Params.items -}}{{- end -}} {{- if gt $itemCount 0 -}} {{ $itemCount }} {{ if eq $itemCount 1 }}Work{{ else }}Works{{ end }} {{- end -}}
{{- $bannerImg := .Resources.GetMatch "banner.png" -}} {{- if not $bannerImg -}}{{- $bannerImg = .Resources.GetMatch "01.png" -}}{{- end -}} {{- if $bannerImg -}}
{{- partial "img.html" (dict "res" $bannerImg "widths" (slice 1200 1800) "sizes" "100vw" "class" "w-full h-full object-cover object-center" "alt" .Title "loading" "eager") -}}
{{- else -}}{{- with .Params.banner -}}
{{- partial "media.html" (dict "media" . "class" "w-full h-full object-cover object-center" "lazy" false) -}}
{{- end -}}{{- end -}} {{- with .Content -}}
{{ . }}
{{- end -}} {{- $bundleImages := .Resources.Match "[0-9]*.png" -}} {{- $legacyItems := slice -}} {{- with .Params.items -}}{{- $legacyItems = . -}}{{- end -}} {{- if or $bundleImages $legacyItems -}}
{{- if $bundleImages -}} {{- /* Pre-compute lightbox items so Alpine gets a static JSON array */ -}} {{- $lbItems := slice -}} {{- range $bundleImages -}} {{- $stem := .Name | strings.TrimSuffix ".png" -}} {{- $video := $.Resources.GetMatch (printf "%s.mp4" $stem) -}} {{- $webp := .Resize "1200x webp" -}} {{- $entry := dict "img" $webp.RelPermalink "video" "" -}} {{- if $video -}}{{- $entry = dict "img" $webp.RelPermalink "video" $video.RelPermalink -}}{{- end -}} {{- $lbItems = $lbItems | append $entry -}} {{- end -}}
Gallery {{ len $bundleImages }} {{ if eq (len $bundleImages) 1 }}work{{ else }}works{{ end }}
{{- range $i, $img := $bundleImages -}} {{- $stem := $img.Name | strings.TrimSuffix ".png" -}} {{- $video := $.Resources.GetMatch (printf "%s.mp4" $stem) -}}
{{- if $video -}} {{- else -}} {{- partial "img.html" (dict "res" $img "widths" (slice 800 1200) "sizes" "(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw" "class" "w-full pointer-events-none") -}} {{- end -}}
{{- end -}}
{{- else -}}
Gallery {{ len $legacyItems }} {{ if eq (len $legacyItems) 1 }}work{{ else }}works{{ end }}
{{- range $i, $item := $legacyItems -}}
{{- partial "media.html" (dict "media" $item "class" "w-full") -}}
{{- with $item.description -}}
{{ . }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}} {{- with .Params.tags -}} {{- end -}} {{- $related := .Site.RegularPages.Related . | first 3 -}} {{- with $related -}}

More Drops

{{- range . -}} {{- partial "post-card.html" . -}} {{- end -}}
{{- end -}} {{- end -}}