diff options
author | Karl <kc0bfv@gmail.com> | 2021-09-13 06:33:01 +0300 |
---|---|---|
committer | Karl <kc0bfv@gmail.com> | 2021-09-13 06:33:01 +0300 |
commit | 2a86709f1cae0ac8ce24f56e76ef7c7e3bc67aa7 (patch) | |
tree | d6b34d55823acef9dfb9129dbe24b30f02e477ed | |
parent | 01e1d1648093b6ba24eb08729d66c0dbd30e387c (diff) |
Fix another zero .File warning
-rw-r--r-- | layouts/partials/scratch_set_retalbumthumb.html | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/layouts/partials/scratch_set_retalbumthumb.html b/layouts/partials/scratch_set_retalbumthumb.html index c718581..b3f0582 100644 --- a/layouts/partials/scratch_set_retalbumthumb.html +++ b/layouts/partials/scratch_set_retalbumthumb.html @@ -11,7 +11,10 @@ {{- /* If no albumthumb is set, get the first image*/}} {{- if or (not (isset .Params "albumthumb")) (eq .Params.albumthumb "") }} - {{- $imgglob := printf "%s" (path.Join .File.Dir "**") }} + {{- with .File }} + {{- $.Scratch.Set "imgglob" (printf "%s" (path.Join .Dir "**")) }} + {{- end }} + {{- $imgglob := default "**" ($.Scratch.Get "imgglob") }} {{- $imageresources := where (resources.Match $imgglob) "ResourceType" "image" }} {{- .Scratch.Set "retalbumthumb" (index $imageresources 0) }} {{- end }} |