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' + }); } } };