aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/count-drafts.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-05-31 21:21:58 -0400
committertdro <tdro@noreply.example.com>2022-05-31 21:21:58 -0400
commitdff47d17bb0ed4479bfb187b19ba1c8b1fa61226 (patch)
treebaf67014b299f1758be5c60a354829df91efa8ad /themes/default/layouts/partials/count-drafts.html
parentfab10521fbd303002b5adba8e026e4c8a8e73a44 (diff)
downloadcanory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.tar.gz
canory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.tar.bz2
canory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.zip
themes/default/layouts/_default: Paginate drafts and categorize
Diffstat (limited to 'themes/default/layouts/partials/count-drafts.html')
-rw-r--r--themes/default/layouts/partials/count-drafts.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/count-drafts.html b/themes/default/layouts/partials/count-drafts.html
new file mode 100644
index 0000000..78b57a5
--- /dev/null
+++ b/themes/default/layouts/partials/count-drafts.html
@@ -0,0 +1,10 @@
+{{ $author := partial "author-user.html" . }}
+{{ $count := 0 }}
+
+{{ range .Site.Pages }}
+ {{ if and (eq .Type $author) .Draft }}
+ {{ $count = add $count 1 }}
+ {{ end }}
+{{ end }}
+
+{{ print (lang.FormatNumberCustom 0 $count) " " "Drafts" }}