fix api index version

This commit is contained in:
Tim Lancina
2015-09-03 14:57:14 -05:00
parent 1008a5b494
commit 70076f350c

View File

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