aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-24 09:18:11 -0400
committertdro <tdro@noreply.example.com>2022-06-24 09:18:11 -0400
commit6575fe56d97ffc5bc03976f48fac8ac87bf26388 (patch)
tree28a526fc34230cbea19ac60e9aab53232a7943a8
parent2358f77fa830467b34c92dc9610e529de647f296 (diff)
downloadcanory-6575fe56d97ffc5bc03976f48fac8ac87bf26388.tar.gz
canory-6575fe56d97ffc5bc03976f48fac8ac87bf26388.tar.bz2
canory-6575fe56d97ffc5bc03976f48fac8ac87bf26388.zip
themes/default/layouts/partials/gallery-walk: Check if profile exists
-rw-r--r--themes/default/layouts/partials/gallery-walk.html46
1 files changed, 24 insertions, 22 deletions
diff --git a/themes/default/layouts/partials/gallery-walk.html b/themes/default/layouts/partials/gallery-walk.html
index 71897b6..6dd9fbd 100644
--- a/themes/default/layouts/partials/gallery-walk.html
+++ b/themes/default/layouts/partials/gallery-walk.html
@@ -33,31 +33,33 @@
{{- end -}}
{{- end -}}
- {{- range readDir (path.Join $folder "profile") -}}
+ {{- if fileExists (path.Join $folder "profile") -}}
+ {{- range readDir (path.Join $folder "profile") -}}
- {{- $name := index (split .Name ".") 0 -}}
- {{- $extension := path.Ext .Name -}}
+ {{- $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")
- (eq $extension ".webp")
- -}}
- {{-
- $files = $files | append (dict
- "Name" .Name
- "Path" (path.Join $folder "profile" .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")
+ (eq $extension ".webp")
-}}
+ {{-
+ $files = $files | append (dict
+ "Name" .Name
+ "Path" (path.Join $folder "profile" .Name)
+ )
+ -}}
+ {{- end -}}
{{- end -}}
{{- end -}}