aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/count-media.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/count-media.html')
-rw-r--r--themes/default/layouts/partials/count-media.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/count-media.html b/themes/default/layouts/partials/count-media.html
new file mode 100644
index 0000000..1d5e49b
--- /dev/null
+++ b/themes/default/layouts/partials/count-media.html
@@ -0,0 +1,17 @@
+{{ $author := partial "author-user.html" . }}
+{{ $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 }}
+
+{{ print (lang.FormatNumberCustom 0 $count) " " "Messages" }}