diff options
author | tdro <tdro@noreply.example.com> | 2022-06-01 22:56:42 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-06-01 22:56:42 -0400 |
commit | d0713b5c29257f689981364d6b4c5df9863dc96a (patch) | |
tree | a1506dfff6be48dac2f254547c7623bed8863584 | |
parent | 96b434641810a7c8301561719da0b12626c16193 (diff) | |
download | canory-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.html | 28 | ||||
-rw-r--r-- | themes/default/layouts/partials/media-search.html | 27 |
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 }} |