From 2f95c0d68d710ef4466176deb0fe952b781ac226 Mon Sep 17 00:00:00 2001 From: Alex Wolfe Date: Sat, 18 Apr 2015 09:30:29 -0700 Subject: [PATCH] next step now auto generated --- public/_includes/_next-item.jade | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/public/_includes/_next-item.jade b/public/_includes/_next-item.jade index afe998f903..9b8119e5ba 100644 --- a/public/_includes/_next-item.jade +++ b/public/_includes/_next-item.jade @@ -1,3 +1,21 @@ -currentItem = false -nextItem = false +currentPage = false +nextPage = false +data = public.docs[current.path[1]][current.path[2]][current.path[3]]._data + +for page, slug in data + + // CHECK IF CURRENT PAGE IS SET, THEN SET NEXT PAGE + if currentPage + if !nextPage + .l-sub-section + h3 Next Step + a(href="/docs/#{current.path[1]}/#{current.path[2]}/#{current.path[3]}/#{slug}.html") #{page.title} + + //NEXT PAGE HAS NOW BEEN SET + nextPage = true + + // SET CURRENT PAGE FLAG WHEN YOU PASS IT + if current.path[4] == slug + currentPage = true +