Merge pull request #2 from stueja/stueja-maxnavitems-patch-2

fix configurable navbar count
This commit is contained in:
Jan 2022-01-12 14:59:48 +01:00 committed by GitHub
commit 4913772a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,7 @@
{{ end }}
{{ end }}
{{- end }}
{{ if gt $sectionCount 5 }}
{{ if gt $sectionCount $maxnavitems }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{i18n "more" }}</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
@ -91,7 +91,7 @@
{{ range sort $sections "section.weight" }}
{{ if and (.section.enable) (.section.showOnNavbar) }}
{{ $sectionCount = add $sectionCount 1}}
{{ if gt $sectionCount 5 }}
{{ if gt $sectionCount $maxnavitems }}
<a class="dropdown-item" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
{{ end }}
{{ end }}