diff options
| author | tdro <tdro@noreply.example.com> | 2025-03-08 00:00:00 +0000 |
|---|---|---|
| committer | tdro <tdro@noreply.example.com> | 2025-03-08 00:00:00 +0000 |
| commit | 00f6eec8836c8fe50956c6ab47980ec267c291e1 (patch) | |
| tree | 7e749bdc6b4c42a250512fe8e31c5e495aac0f9a | |
| parent | 223c8ef7e2d8b795f6132a360dc570c74e872b1e (diff) | |
| download | canory-00f6eec8836c8fe50956c6ab47980ec267c291e1.tar.gz canory-00f6eec8836c8fe50956c6ab47980ec267c291e1.tar.bz2 canory-00f6eec8836c8fe50956c6ab47980ec267c291e1.zip | |
themes/default/layouts/partials/gallery-walk: Clear up
| -rw-r--r-- | themes/default/layouts/partials/gallery-walk.html | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/themes/default/layouts/partials/gallery-walk.html b/themes/default/layouts/partials/gallery-walk.html index e5b8f90..c1e9198 100644 --- a/themes/default/layouts/partials/gallery-walk.html +++ b/themes/default/layouts/partials/gallery-walk.html @@ -1,8 +1,8 @@ {{- $data := slice -}} -{{- $author := partial "function-authors-data.html" . -}} +{{- $author := .Section -}} {{- $filteredPages := partial "function-filters-content.html" .Site.RegularPages -}} -{{- range (where $filteredPages "Section" $author.user) -}} +{{- range (where $filteredPages "Section" $author) -}} {{- if in .Content "<picture>" -}} {{- $data = $data | append (dict "relatedHref" (.Permalink) @@ -24,27 +24,28 @@ {{- if $data -}} {{- range $image := $data }} - <a href="{{ $image.relatedHref }}"> - <picture> - {{- with $image.srcset -}} - <source - {{ $image.srcset | safeHTMLAttr }} - {{ $image.type | safeHTMLAttr }} + {{- $dimensions := ne (index (last 1 (split $image.width "=")) 0) `""` }} + <a href="{{ $image.relatedHref }}"> + <picture> + {{- with $image.srcset }} + <source + {{ $image.srcset | safeHTMLAttr }} + {{ $image.type | safeHTMLAttr }} + /> + {{- end }} + <img + loading="lazy" + {{ $image.alt | safeHTMLAttr }} + {{ $image.title | safeHTMLAttr }} + {{ with $dimensions }} + {{ $image.width | safeHTMLAttr }} + {{ $image.height | safeHTMLAttr }} + {{ end }} + {{ $image.src | safeHTMLAttr }} + {{ $image.style | safeHTMLAttr }} /> - {{- end -}} - <img - loading="lazy" - {{ $image.alt | safeHTMLAttr }} - {{ $image.title | safeHTMLAttr }} - {{ with ne (index (last 1 (split $image.width "=")) 0) `""` }} - {{ $image.width | safeHTMLAttr }} - {{ $image.height | safeHTMLAttr }} - {{ end }} - {{ $image.src | safeHTMLAttr }} - {{ $image.style | safeHTMLAttr }} - /> - </picture> - </a> + </picture> + </a> {{ end }} <gallery-overlay></gallery-overlay> {{- end -}} |
