theme-blog-ewen/layouts/partials/section-menu.html

16 lines
443 B
HTML
Raw Normal View History

2020-04-12 08:16:04 +00:00
{{ $page := .currentPage }}
{{ range .menu }}
{{ $posts := (where .Pages "File.Dir" "in" .Dir) }}
{{ $postCount := len $posts }}
<li>
<a href="{{ .URL }}" class="{{ if or (.IsAncestor $page) (eq . $page) }}active{{ end }}">{{ .Name }}</a>
{{/* if ne $postCount 0 */}}{{/* $postCount */}}{{/* end */}}
<ul>
{{ if .Sections }}
{{ partial "section-menu.html" (dict "menu" .Sections "currentPage" $page) }}
{{ end }}
</ul>
</li>
{{ end }}