aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/count-drafts.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/count-drafts.html')
-rw-r--r--themes/default/layouts/partials/count-drafts.html13
1 files changed, 5 insertions, 8 deletions
diff --git a/themes/default/layouts/partials/count-drafts.html b/themes/default/layouts/partials/count-drafts.html
index 78b57a5..fae0b90 100644
--- a/themes/default/layouts/partials/count-drafts.html
+++ b/themes/default/layouts/partials/count-drafts.html
@@ -1,10 +1,7 @@
-{{ $author := partial "author-user.html" . }}
-{{ $count := 0 }}
+{{- $author := .Section -}}
-{{ range .Site.Pages }}
- {{ if and (eq .Type $author) .Draft }}
- {{ $count = add $count 1 }}
- {{ end }}
-{{ end }}
+{{- $authors := where .Site.RegularPages "Section" $author -}}
+{{- $drafts := where .Site.RegularPages "Draft" true -}}
+{{- $filteredPages := $authors | intersect $drafts -}}
-{{ print (lang.FormatNumberCustom 0 $count) " " "Drafts" }}
+{{- print (lang.FormatNumberCustom 0 (len $filteredPages)) -}}