diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 6b11ea63c1..67d72026e9 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -35,7 +35,11 @@ {{ $.Scratch.Set "first" $index }} {{ else }} {{ $.Scratch.Set "first" (index $value 0).Page }} - {{ $.Scratch.Set "_value" (after 1 $value) }} + {{ if gt $value.Len 1 }} + {{ $.Scratch.Set "_value" (after 1 $value) }} + {{ else }} + {{ $.Scratch.Set "_value" nil }} + {{ end }} {{ end }} {{ end }} {{ $first := $.Scratch.Get "first" }}