From 9144ca72aa6ce90753b12340757600ae516299f4 Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Sun, 26 Mar 2017 05:06:15 +0300 Subject: [PATCH] Fixed "error calling after: no items left" --- layouts/partials/menu.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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" }}