diff --git a/scripts/docs/processors/index-page.js b/scripts/docs/processors/index-page.js index 2e387d9099..51ce1ef3b4 100644 --- a/scripts/docs/processors/index-page.js +++ b/scripts/docs/processors/index-page.js @@ -5,15 +5,19 @@ module.exports = function indexPage(renderDocsProcessor) { $runAfter: ['adding-extra-docs'], $runBefore: ['extra-docs-added'], $process: function(docs) { - var currentVersion = renderDocsProcessor.extraData.version.current.name; + var versionData = renderDocsProcessor.extraData.version; + var currentVersion = versionData.current.name; + var latestVersion = versionData.latest.name; - docs.push({ - docType: 'index-page', - id: 'index-page', - currentVersion: currentVersion, - template: 'api_index.template.html', - outputPath: 'docs/' + currentVersion + '/api/index.md' - }); + if (currentVersion == latestVersion) { + docs.push({ + docType: 'index-page', + id: 'index-page', + currentVersion: currentVersion, + template: 'api_index.template.html', + outputPath: 'docs/api/index.md' + }); + } } } };