aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts')
-rw-r--r--themes/default/layouts/partials/count-drafts.html11
-rw-r--r--themes/default/layouts/partials/count-feeds.html11
-rw-r--r--themes/default/layouts/partials/count-marks.html7
-rw-r--r--themes/default/layouts/partials/count-media.html4
-rw-r--r--themes/default/layouts/partials/count.html3
5 files changed, 10 insertions, 26 deletions
diff --git a/themes/default/layouts/partials/count-drafts.html b/themes/default/layouts/partials/count-drafts.html
index 95f04ed..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" . -}}
-{{- $count := 0 -}}
+{{- $author := .Section -}}
-{{- $authors := where .Site.RegularPages "Section" $author.user -}}
+{{- $authors := where .Site.RegularPages "Section" $author -}}
{{- $drafts := where .Site.RegularPages "Draft" true -}}
{{- $filteredPages := $authors | intersect $drafts -}}
-{{- range $filteredPages -}}
- {{- $count = add $count 1 -}}
-{{- end -}}
-
-{{- print (lang.FormatNumberCustom 0 $count) -}}
+{{- print (lang.FormatNumberCustom 0 (len $filteredPages)) -}}
diff --git a/themes/default/layouts/partials/count-feeds.html b/themes/default/layouts/partials/count-feeds.html
index b3053e2..68495da 100644
--- a/themes/default/layouts/partials/count-feeds.html
+++ b/themes/default/layouts/partials/count-feeds.html
@@ -1,12 +1,7 @@
-{{- $author := partial "function-authors-data.html" . -}}
-{{- $count := 0 -}}
+{{- $author := .Section -}}
{{- $feeds := where .Site.Pages "Params.feed" "ne" nil -}}
-{{- $authors := where .Site.Pages "Section" $author.user -}}
+{{- $authors := where .Site.Pages "Section" $author -}}
{{- $filteredPages := $authors | intersect $feeds -}}
-{{- range $filteredPages -}}
- {{- $count = add $count 1 -}}
-{{- end -}}
-
-{{- print (lang.FormatNumberCustom 0 $count) -}}
+{{- print (lang.FormatNumberCustom 0 (len $filteredPages)) -}}
diff --git a/themes/default/layouts/partials/count-marks.html b/themes/default/layouts/partials/count-marks.html
index b251555..deb532d 100644
--- a/themes/default/layouts/partials/count-marks.html
+++ b/themes/default/layouts/partials/count-marks.html
@@ -1,11 +1,6 @@
-{{- $count := 0 -}}
{{- $author := .Section -}}
{{- $items := where .Site.RegularPages ".Params.marked" true -}}
{{- $authors := where .Site.RegularPages "Section" $author -}}
{{- $filteredPages := $authors | intersect $items -}}
-{{- range $filteredPages -}}
- {{- $count = add $count 1 -}}
-{{- end -}}
-
-{{- print (lang.FormatNumberCustom 0 $count) -}}
+{{- print (lang.FormatNumberCustom 0 (len $filteredPages)) -}}
diff --git a/themes/default/layouts/partials/count-media.html b/themes/default/layouts/partials/count-media.html
index 8a409e7..1d68e0a 100644
--- a/themes/default/layouts/partials/count-media.html
+++ b/themes/default/layouts/partials/count-media.html
@@ -1,6 +1,6 @@
-{{- $author := partial "function-authors-data.html" . -}}
+{{- $author := .Section -}}
{{- $notFeeds := where .Site.RegularPages "Params.feed" "eq" nil -}}
-{{- $authors := where .Site.RegularPages "Section" $author.user -}}
+{{- $authors := where .Site.RegularPages "Section" $author -}}
{{- $filteredPages := $authors | intersect $notFeeds -}}
{{- $count := 0 -}}
diff --git a/themes/default/layouts/partials/count.html b/themes/default/layouts/partials/count.html
index b561439..72b5d03 100644
--- a/themes/default/layouts/partials/count.html
+++ b/themes/default/layouts/partials/count.html
@@ -1,2 +1 @@
-{{- $count := len .Site.RegularPages -}}
-{{- print (lang.FormatNumberCustom 0 $count) -}}
+{{- print (lang.FormatNumberCustom 0 (len .Site.RegularPages)) -}}