diff options
author | tdro <tdro@noreply.example.com> | 2023-06-10 18:16:04 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-06-10 18:16:04 -0400 |
commit | 77f6dfc5b8d98b2d47788988eb4bcf7449f8f782 (patch) | |
tree | 584ff99e325cd0585fd63614b111b41a7b18e425 /themes/default/layouts/partials/count-likes.html | |
parent | 067038f579efeae47e6a9560313f0e948996c553 (diff) | |
download | canory-77f6dfc5b8d98b2d47788988eb4bcf7449f8f782.tar.gz canory-77f6dfc5b8d98b2d47788988eb4bcf7449f8f782.tar.bz2 canory-77f6dfc5b8d98b2d47788988eb4bcf7449f8f782.zip |
themes/default/layouts/partials/count: Cleanup counters
Diffstat (limited to 'themes/default/layouts/partials/count-likes.html')
-rw-r--r-- | themes/default/layouts/partials/count-likes.html | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/themes/default/layouts/partials/count-likes.html b/themes/default/layouts/partials/count-likes.html index 3b8a9ef..7a241f3 100644 --- a/themes/default/layouts/partials/count-likes.html +++ b/themes/default/layouts/partials/count-likes.html @@ -1,12 +1,12 @@ {{- $author := partial "function-authors-data.html" . -}} -{{- $author = $author.user -}} +{{- $count := 0 -}} -{{ $count := 0 }} +{{- $likes := where .Site.RegularPages ".Params.liked" true -}} +{{- $authors := where .Site.RegularPages "Section" $author.user -}} +{{- $filteredPages := $authors | intersect $likes -}} -{{ range .Site.Pages }} - {{ if and (eq .Type $author) .Params.Liked }} - {{ $count = add $count 1 }} - {{ end }} -{{ end }} +{{- range $filteredPages -}} + {{- $count = add $count 1 -}} +{{- end -}} -{{ print (lang.FormatNumberCustom 0 $count) " " "Messages" }} +{{- print (lang.FormatNumberCustom 0 $count) " " "Messages" -}} |