aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/media-search.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/media-search.html')
-rw-r--r--themes/default/layouts/partials/media-search.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/media-search.html b/themes/default/layouts/partials/media-search.html
new file mode 100644
index 0000000..5954d16
--- /dev/null
+++ b/themes/default/layouts/partials/media-search.html
@@ -0,0 +1,27 @@
+{{ $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 }}