Merge pull request #1 from stueja/stueja-maxnavitems-patch-1
configurable navbar items
This commit is contained in:
commit
dfb7bb3a91
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
{{/* variables for enabling/disabling various features */}}
|
{{/* variables for enabling/disabling various features */}}
|
||||||
{{ $blogEnabled := site.Params.features.blog.enable | default false }}
|
{{ $blogEnabled := site.Params.features.blog.enable | default false }}
|
||||||
{{ $notesEnabled := site.Params.features.notes.enable | default false }}
|
{{ $notesEnabled := site.Params.features.notes.enable | default false }}
|
||||||
|
{{ $maxnavitems := site.Params.features.maxnavitems | default 5 }}
|
||||||
|
|
||||||
{{/* keep backward compatibility for blog post */}}
|
{{/* keep backward compatibility for blog post */}}
|
||||||
{{ if site.Params.enableBlogPost }}
|
{{ if site.Params.enableBlogPost }}
|
||||||
|
@ -75,7 +76,7 @@
|
||||||
{{ range sort $sections "section.weight" }}
|
{{ range sort $sections "section.weight" }}
|
||||||
{{ if and (.section.enable) (.section.showOnNavbar)}}
|
{{ if and (.section.enable) (.section.showOnNavbar)}}
|
||||||
{{ $sectionCount = add $sectionCount 1}}
|
{{ $sectionCount = add $sectionCount 1}}
|
||||||
{{ if le $sectionCount 5 }}
|
{{ if le $sectionCount $maxnavitems }}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
|
<a class="nav-link" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue