From 7f8f4c2dbe5fbf157fd21558a6856fd11c8ea43c Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 26 May 2022 19:06:10 -0400 Subject: themes/default/layouts/_default/feeds: Count feeds --- themes/default/layouts/_default/feeds.html | 2 +- themes/default/layouts/partials/count-feeds.html | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 themes/default/layouts/partials/count-feeds.html diff --git a/themes/default/layouts/_default/feeds.html b/themes/default/layouts/_default/feeds.html index 238887f..f924d50 100644 --- a/themes/default/layouts/_default/feeds.html +++ b/themes/default/layouts/_default/feeds.html @@ -20,7 +20,7 @@ {{ partial "navigator-middle.html" (dict "Title" "Feeds" - "Subtitle" (partial "count-media.html" .) + "Subtitle" (partial "count-feeds.html" .) "Icon" "arrow-left" "IconLabel" "Back" "Href" "/" diff --git a/themes/default/layouts/partials/count-feeds.html b/themes/default/layouts/partials/count-feeds.html new file mode 100644 index 0000000..cf54180 --- /dev/null +++ b/themes/default/layouts/partials/count-feeds.html @@ -0,0 +1,12 @@ +{{ $author := partial "author-user.html" . }} +{{ $count := 0 }} + +{{ range .Site.Pages }} + {{ if .Params.feed }} + {{ if eq .Type $author }} + {{ $count = add $count 1 }} + {{ end }} + {{ end }} +{{ end }} + +{{ print (lang.FormatNumberCustom 0 $count) " " "Messages" }} -- cgit v1.2.3