aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/gallery-walk.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/gallery-walk.html')
-rw-r--r--themes/default/layouts/partials/gallery-walk.html31
1 files changed, 13 insertions, 18 deletions
diff --git a/themes/default/layouts/partials/gallery-walk.html b/themes/default/layouts/partials/gallery-walk.html
index 6c2206f..ca95d3f 100644
--- a/themes/default/layouts/partials/gallery-walk.html
+++ b/themes/default/layouts/partials/gallery-walk.html
@@ -1,18 +1,9 @@
-{{- $data := slice -}}
-{{- $author := partial "function-authors-data.html" . -}}
+{{- $data := slice -}}
+{{- $author := partial "function-authors-data.html" . -}}
+{{- $filteredPages := partial "function-filters-content.html" .Site.RegularPages -}}
-{{- $mimes := slice
- "image/apng"
- "image/avif"
- "image/gif"
- "image/jpeg"
- "image/png"
- "image/svg+xml"
- "image/webp"
--}}
-
-{{- range (where .Site.RegularPages "Params.Author" $author.user) -}}
- {{- if in .Content "<figure>" -}}
+{{- range (where $filteredPages "Section" $author.user) -}}
+ {{- if in .Content "<picture>" -}}
{{- $data = $data | append (dict
"alt" (delimit (findRE `(?sU)alt=".*"` .Content 1) "")
"height" (delimit (findRE `(?sU)height=".*"` .Content 1) "")
@@ -35,16 +26,20 @@
{{- range $image := $data }}
<a href="{{ $image.relatedHref }}">
<picture>
- <source
- {{ $image.srcset | safeHTMLAttr }}
- {{ $image.type | safeHTMLAttr }}
- />
+ {{- with $image.srcset -}}
+ <source
+ {{ $image.srcset | safeHTMLAttr }}
+ {{ $image.type | 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 }}
/>