From 69558d4de9f784b7e7b840aaac7735beee74039a Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Fri, 14 Jan 2022 01:27:51 +0600 Subject: [PATCH] Move `features.maxnavitems` into `topNavbar.maxVisibleSections` Signed-off-by: hossainemruz --- layouts/partials/navigators/navbar.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/layouts/partials/navigators/navbar.html b/layouts/partials/navigators/navbar.html index 5ecc5f9..33552a4 100644 --- a/layouts/partials/navigators/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -1,7 +1,7 @@ {{/* variables for enabling/disabling various features */}} {{ $blogEnabled := site.Params.features.blog.enable | default false }} {{ $notesEnabled := site.Params.features.notes.enable | default false }} -{{ $maxnavitems := site.Params.features.maxnavitems | default 5 }} +{{ $maxVisibleSections := site.Params.topNavbar.maxVisibleSections | default 5 }} {{/* keep backward compatibility for blog post */}} {{ if site.Params.enableBlogPost }} @@ -72,18 +72,18 @@ {{ i18n "home" }} {{ if $sections }} - {{ $sectionCount := 0}} + {{ $sectionCount := 1 }} {{ range sort $sections "section.weight" }} {{ if and (.section.enable) (.section.showOnNavbar)}} {{ $sectionCount = add $sectionCount 1}} - {{ if le $sectionCount $maxnavitems }} + {{ if le $sectionCount $maxVisibleSections }} {{ end }} {{ end }} {{- end }} - {{ if gt $sectionCount $maxnavitems }} + {{ if gt $sectionCount $maxVisibleSections }}