aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/media.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-01 22:56:42 -0400
committertdro <tdro@noreply.example.com>2022-06-01 22:56:42 -0400
commitd0713b5c29257f689981364d6b4c5df9863dc96a (patch)
treea1506dfff6be48dac2f254547c7623bed8863584 /themes/default/layouts/_default/media.html
parent96b434641810a7c8301561719da0b12626c16193 (diff)
downloadcanory-d0713b5c29257f689981364d6b4c5df9863dc96a.tar.gz
canory-d0713b5c29257f689981364d6b4c5df9863dc96a.tar.bz2
canory-d0713b5c29257f689981364d6b4c5df9863dc96a.zip
themes/default/layouts/_default/media: Merge with media search
Diffstat (limited to 'themes/default/layouts/_default/media.html')
-rw-r--r--themes/default/layouts/_default/media.html28
1 files changed, 27 insertions, 1 deletions
diff --git a/themes/default/layouts/_default/media.html b/themes/default/layouts/_default/media.html
index cf822e8..f4bb3a9 100644
--- a/themes/default/layouts/_default/media.html
+++ b/themes/default/layouts/_default/media.html
@@ -31,7 +31,33 @@
{{ partial "profile.html" . }}
- {{ partial "media-search.html" . }}
+ {{- $author := partial "author-user.html" . -}}
+
+ {{ $count := 0 }}
+ {{ $result := false }}
+
+ {{ range .Site.Pages }}
+ {{ if or
+ (in .Content "<figure>")
+ (in .Content "<imgur-video>")
+ (in .Content "<youtube-video>")
+ (in .Content "<video-container>")
+ }}
+ {{ if eq .Type $author }}
+ {{ $result = true }}
+ {{ $count = add $count 1 }}
+ {{ if le $count 10 }}
+ {{ .Render "summary" }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+
+ {{ if not $result }}
+ <footer>
+ <code>No media found!</code>
+ </footer>
+ {{ end }}
{{ partial "pagination.html" . }}