From 865877321268e0a2484a87b75bcb2507a3932278 Mon Sep 17 00:00:00 2001 From: Jason Tipton Date: Thu, 2 Jul 2020 07:21:09 -0800 Subject: [PATCH] Find first section for chevron navigation (#26) * Find first section for chevron navigation * Handle disabled section Co-authored-by: hossainemruz --- layouts/partials/home.html | 7 +++++-- layouts/partials/navbar.html | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/layouts/partials/home.html b/layouts/partials/home.html index 90e3dd7..2f825a7 100644 --- a/layouts/partials/home.html +++ b/layouts/partials/home.html @@ -25,7 +25,10 @@
  • {{ . }}
  • {{ end }} - - + {{ if .Site.Data.sections }} + {{ range first 1 (where (sort .Site.Data.sections "section.weight") ".section.enable" true) }} + + {{ end }} + {{ end }} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 253c54d..00570c7 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -21,7 +21,7 @@ {{- if .Site.Data.sections }} {{- range sort .Site.Data.sections "section.weight" }} - {{ if .section.showOnNavbar }} + {{ if (and .section.enable .section.showOnNavbar) }}