do not count hidden pages in taxonomy pages #124

This commit is contained in:
Dmitry Kolosov 2021-12-27 20:17:40 +03:00
parent 0c92c7b71a
commit 36f693a61c

View File

@ -4,15 +4,15 @@
</div> </div>
<h1>{{ i18n .Title }}</h1> <h1>{{ i18n .Title }}</h1>
<ul class="terms"> <ul class="terms">
{{ range $key, $value := .Data.Terms }} {{ range .Data.Terms }}
<li> {{ $postsNum := len (where .Pages "Params.hidden" "!=" true) }}
<a href="{{ (print $.Data.Plural "/" (lower $key)) | absLangURL }}"> {{ if gt $postsNum 0 }}
{{ $key }} <li>
</a> <a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a>
({{ len $value }}) ({{ $postsNum }})
</li> </li>
{{ end}}
{{ end }} {{ end }}
</ul> </ul>