diff options
author | tdro <tdro@noreply.example.com> | 2022-06-17 19:21:29 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-06-17 19:21:29 -0400 |
commit | 0d3bc7c09ed5e117d87c0159bc9fbb6daee63f94 (patch) | |
tree | 8a4091e61afa166a7ae7f50ee9c9974b0ceff2a0 /themes/default/layouts/partials/gallery-walk.html | |
parent | a586014294b33d86a7f961c0b7daf82f46cb1e99 (diff) | |
download | canory-0d3bc7c09ed5e117d87c0159bc9fbb6daee63f94.tar.gz canory-0d3bc7c09ed5e117d87c0159bc9fbb6daee63f94.tar.bz2 canory-0d3bc7c09ed5e117d87c0159bc9fbb6daee63f94.zip |
themes/default/layouts/partials/gallery-walk: Add no media notification
Diffstat (limited to 'themes/default/layouts/partials/gallery-walk.html')
-rw-r--r-- | themes/default/layouts/partials/gallery-walk.html | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/themes/default/layouts/partials/gallery-walk.html b/themes/default/layouts/partials/gallery-walk.html index f88d31a..101f7e1 100644 --- a/themes/default/layouts/partials/gallery-walk.html +++ b/themes/default/layouts/partials/gallery-walk.html @@ -2,9 +2,9 @@ {{- $dimensions := "320x320" -}} {{- if fileExists $folder }} - {{- $files := readDir $folder }} + {{- $files := where (readDir $folder) "Name" "not in" (slice "page" "rss.xml" "index.html") }} {{- if $files }} - {{- range first 5 (where $files "Name" "not in" (slice "page" "rss.xml" "index.html")) }} + {{- range first 5 $files }} {{- if not .IsDir }} @@ -35,14 +35,18 @@ src="{{ $imageContent.RelPermalink }}" /> {{ end }} - {{- end }} + {{- end -}} - {{- end }} + {{- end -}} {{- if .IsDir }} {{- partial "gallery-walk.html" (path.Join $folder .Name) }} {{- end }} - {{- end }} - {{- end }} + {{- end -}} + {{- end -}} +{{- else -}} + <footer> + <code>No media found!</code> + </footer> {{- end }} |