Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kc0bfv/autophugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl <kc0bfv@gmail.com>2021-09-13 06:33:01 +0300
committerKarl <kc0bfv@gmail.com>2021-09-13 06:33:01 +0300
commit2a86709f1cae0ac8ce24f56e76ef7c7e3bc67aa7 (patch)
treed6b34d55823acef9dfb9129dbe24b30f02e477ed
parent01e1d1648093b6ba24eb08729d66c0dbd30e387c (diff)
Fix another zero .File warning
-rw-r--r--layouts/partials/scratch_set_retalbumthumb.html5
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 }}