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.html15
1 files changed, 5 insertions, 10 deletions
diff --git a/themes/default/layouts/partials/count-drafts.html b/themes/default/layouts/partials/count-drafts.html
index 3c0cc5a..fae0b90 100644
--- a/themes/default/layouts/partials/count-drafts.html
+++ b/themes/default/layouts/partials/count-drafts.html
@@ -1,12 +1,7 @@
-{{- $author := partial "function-authors-data.html" . -}}
-{{- $author = $author.user -}}
+{{- $author := .Section -}}
-{{ $count := 0 }}
+{{- $authors := where .Site.RegularPages "Section" $author -}}
+{{- $drafts := where .Site.RegularPages "Draft" true -}}
+{{- $filteredPages := $authors | intersect $drafts -}}
-{{ range .Site.Pages }}
- {{ if and (eq .Type $author) .Draft }}
- {{ $count = add $count 1 }}
- {{ end }}
-{{ end }}
-
-{{ print (lang.FormatNumberCustom 0 $count) " " "Drafts" }}
+{{- print (lang.FormatNumberCustom 0 (len $filteredPages)) -}}