From 3bfaabb993747b1eeec1fd4c54196c7e2e9e7d4d Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Fri, 4 Sep 2015 15:34:40 -0500 Subject: [PATCH] build doc index to version dir if not latest --- scripts/docs/processors/index-page.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/docs/processors/index-page.js b/scripts/docs/processors/index-page.js index 30cc9fb8f3..88bcf3762c 100644 --- a/scripts/docs/processors/index-page.js +++ b/scripts/docs/processors/index-page.js @@ -10,15 +10,15 @@ module.exports = function indexPage(renderDocsProcessor) { var currentVersion = versionData.current.name; var latestVersion = versionData.latest.name; - if (currentVersion == latestVersion) { - docs.push({ - docType: 'index-page', - id: 'index-page', - currentVersion: currentVersion, - template: 'api_index.template.html', - outputPath: 'docs/api/index.md' - }); - } + var versionPath = currentVersion == latestVersion ? '' : currentVersion; + + docs.push({ + docType: 'index-page', + id: 'index-page', + currentVersion: currentVersion, + template: 'api_index.template.html', + outputPath: 'docs/' + versionPath + '/api/index.md' + }); } } };