diff options
Diffstat (limited to 'themes/default/layouts/partials/count-media.html')
-rw-r--r-- | themes/default/layouts/partials/count-media.html | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/themes/default/layouts/partials/count-media.html b/themes/default/layouts/partials/count-media.html index 1d5e49b..1d68e0a 100644 --- a/themes/default/layouts/partials/count-media.html +++ b/themes/default/layouts/partials/count-media.html @@ -1,17 +1,20 @@ -{{ $author := partial "author-user.html" . }} -{{ $count := 0 }} +{{- $author := .Section -}} +{{- $notFeeds := where .Site.RegularPages "Params.feed" "eq" nil -}} +{{- $authors := where .Site.RegularPages "Section" $author -}} +{{- $filteredPages := $authors | intersect $notFeeds -}} +{{- $count := 0 -}} -{{ range .Site.Pages }} - {{ if or - (in .Content "<figure>") - (in .Content "<imgur-video>") - (in .Content "<youtube-video>") - (in .Content "<video-container>") - }} - {{ if eq .Type $author }} - {{ $count = add $count 1 }} - {{ end }} - {{ end }} -{{ end }} +{{- range first 100 $filteredPages -}} + {{- if eq $count 10 -}} + {{- break -}} + {{- end -}} + {{- if or + (in .Content "</video>") + (in .Content "</picture>") + (in .Content "</youtube-video>") + -}} + {{- $count = add $count 1 -}} + {{- end -}} +{{- end -}} -{{ print (lang.FormatNumberCustom 0 $count) " " "Messages" }} +{{- print (lang.FormatNumberCustom 0 $count) -}} |