Hi
I’m trying to add a job counter to a menu item. Something like "Jobs (2)"
I have found that
{{ len .Site.Sections.jobs }}
gives me the correct count when used separately, but when I put it in the range to render the menu (see below), it doesn’t work anymore.
{{ range .Site.Menus.main }}
{{ if eq .Identifier "jobs" }}
<li><a href="{{.URL}}">{{.Name}}<span class='job-count'>{{ len .Site.Sections.jobs }}</span></a></li>
{{ else }}
<li><a href="{{.URL}}">{{.Name}}</a></li>
{{end}}
{{end}}
Any ideas why that is? Or how this could be fixed?
Thanks!