aboutsummaryrefslogtreecommitdiff
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
parent96b434641810a7c8301561719da0b12626c16193 (diff)
downloadcanory-d0713b5c29257f689981364d6b4c5df9863dc96a.tar.gz
canory-d0713b5c29257f689981364d6b4c5df9863dc96a.tar.bz2
canory-d0713b5c29257f689981364d6b4c5df9863dc96a.zip
themes/default/layouts/_default/media: Merge with media search
-rw-r--r--themes/default/layouts/_default/media.html28
-rw-r--r--themes/default/layouts/partials/media-search.html27
2 files changed, 27 insertions, 28 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" . }}
diff --git a/themes/default/layouts/partials/media-search.html b/themes/default/layouts/partials/media-search.html
deleted file mode 100644
index 5954d16..0000000
--- a/themes/default/layouts/partials/media-search.html
+++ /dev/null
@@ -1,27 +0,0 @@
-{{ $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 }}