diff options
author | tdro <tdro@noreply.example.com> | 2022-08-28 00:08:03 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-08-28 00:08:03 -0400 |
commit | 5c08d7666c3b4f75207822344edb7f54e1c4b0cb (patch) | |
tree | cd180a073bc1988cfb99f7982e74a4d833164e31 /themes/default/layouts/partials/gallery-walk.html | |
parent | b77c159ae5cfc45e7fd80457e840e769fc97b555 (diff) | |
download | canory-5c08d7666c3b4f75207822344edb7f54e1c4b0cb.tar.gz canory-5c08d7666c3b4f75207822344edb7f54e1c4b0cb.tar.bz2 canory-5c08d7666c3b4f75207822344edb7f54e1c4b0cb.zip |
themes/default/layouts/partials/function-caches-images: Merge alternate copy properties
Compensate for fit and resize. Set images from user profile configuration.
Diffstat (limited to 'themes/default/layouts/partials/gallery-walk.html')
-rw-r--r-- | themes/default/layouts/partials/gallery-walk.html | 59 |
1 files changed, 14 insertions, 45 deletions
diff --git a/themes/default/layouts/partials/gallery-walk.html b/themes/default/layouts/partials/gallery-walk.html index 3572ecf..8a22ccf 100644 --- a/themes/default/layouts/partials/gallery-walk.html +++ b/themes/default/layouts/partials/gallery-walk.html @@ -32,54 +32,23 @@ {{- end -}} {{- end -}} - {{- if fileExists (path.Join $folder "profile") -}} - {{- range readDir (path.Join $folder "profile") -}} - - {{- $name := index (split .Name ".") 0 -}} - {{- $extension := path.Ext .Name -}} - - {{- if or - (eq $extension ".apng") - (eq $extension ".avif") - (eq $extension ".gif") - (eq $extension ".jfif") - (eq $extension ".jpeg") - (eq $extension ".jpg") - (eq $extension ".pjp") - (eq $extension ".pjpeg") - (eq $extension ".png") - (eq $extension ".svg") - (eq $extension ".webp") - -}} - {{- - $files = $files | append (dict - "Name" .Name - "Path" (path.Join $folder "profile" .Name) - ) - -}} - {{- end -}} - {{- end -}} - {{- end -}} - {{- if $files }} {{- range first 6 $files }} - {{- if not .IsDir }} - {{- with $image := resources.Get .Path -}} - {{- $image = (.Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/gallery-walker_" (path.Base .))).Fit (print $dimensions " webp") }} - <picture> - <source srcset="{{- $image.RelPermalink -}}" type="image/webp" /> - {{- $image = (.Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/gallery-walker_" (path.Base .))).Fit (print $dimensions " png") }} - <img - alt="{{- .Name }}" - title="{{- .Name }}" - width="{{ $image.Width }}" - height="{{ $image.Height }}" - src="{{ $image.RelPermalink }}" - /> - </picture> - {{ end }} - {{- end -}} + {{- with $image := resources.Get .Path -}} + {{- $image = (.Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/gallery-walker_" (path.Base .))).Fit (print $dimensions " webp") }} + <picture> + <source srcset="{{- $image.RelPermalink -}}" type="image/webp" /> + {{- $image = (.Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/gallery-walker_" (path.Base .))).Fit (print $dimensions " png") }} + <img + alt="{{- .Name }}" + title="{{- .Name }}" + width="{{ $image.Width }}" + height="{{ $image.Height }}" + src="{{ $image.RelPermalink }}" + /> + </picture> + {{- end -}} {{- end -}} {{- else -}} |