build doc index to version dir if not latest

This commit is contained in:
Tim Lancina
2015-09-04 15:34:40 -05:00
parent 920701e3fd
commit 3bfaabb993

View File

@ -10,15 +10,15 @@ module.exports = function indexPage(renderDocsProcessor) {
var currentVersion = versionData.current.name; var currentVersion = versionData.current.name;
var latestVersion = versionData.latest.name; var latestVersion = versionData.latest.name;
if (currentVersion == latestVersion) { var versionPath = currentVersion == latestVersion ? '' : currentVersion;
docs.push({
docType: 'index-page', docs.push({
id: 'index-page', docType: 'index-page',
currentVersion: currentVersion, id: 'index-page',
template: 'api_index.template.html', currentVersion: currentVersion,
outputPath: 'docs/api/index.md' template: 'api_index.template.html',
}); outputPath: 'docs/' + versionPath + '/api/index.md'
} });
} }
} }
}; };