From ee5096f91669ff875ac87ce3b83cef3fa4225cc0 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 17 Mar 2016 08:09:34 +0000 Subject: [PATCH] fix(version-dropdown): allow deeper paths to API pages This is a horrible hack but it works (for now). Really this needs to be made generic to cope with any level of path. Closes #970 --- public/_includes/_version-dropdown.jade | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/public/_includes/_version-dropdown.jade b/public/_includes/_version-dropdown.jade index 38e167a1fd..2343e2f77c 100644 --- a/public/_includes/_version-dropdown.jade +++ b/public/_includes/_version-dropdown.jade @@ -9,7 +9,19 @@ if current.path[2] - var version = current.path[2].replace(/\_+/gm, ".") -if current.path[4] +if current.path[6] + if public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]][current.path[5]][current.path[6]] + - var page = current.path[3] + '/' + current.path[4] + current.path[5] + current.path[6] + '/' + else + - var page = current.path[3] + '/' + current.path[4] + current.path[5] + current.path[6] + '.html' + +else if current.path[5] + if public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]][current.path[5]] + - var page = current.path[3] + '/' + current.path[4] + current.path[5] + '/' + else + - var page = current.path[3] + '/' + current.path[4] + current.path[5] + '.html' + +else if current.path[4] if public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]] - var page = current.path[3] + '/' + current.path[4] + '/' else