From 75ad6902a5e0a3a23bbbfacc208cda4aee3be83a Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 12 Jan 2022 14:40:10 +0100 Subject: [PATCH] configurable navbar item count Make the number of navbar items outside "More" configurable via ``` config.yaml --- params: features: maxnavitems: 6 ``` --- layouts/partials/navigators/navbar.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/partials/navigators/navbar.html b/layouts/partials/navigators/navbar.html index ed6cff9..a5daefe 100644 --- a/layouts/partials/navigators/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -1,6 +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 }} {{/* keep backward compatibility for blog post */}} {{ if site.Params.enableBlogPost }} @@ -75,7 +76,7 @@ {{ range sort $sections "section.weight" }} {{ if and (.section.enable) (.section.showOnNavbar)}} {{ $sectionCount = add $sectionCount 1}} - {{ if le $sectionCount 5 }} + {{ if le $sectionCount $maxnavitems }}