Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(versioning): modify versioning for < v1.0.1 #11132

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions docs/app/src/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ angular.module('versions', [])
};

$scope.jumpToDocsVersion = function(version) {
var currentPagePath = $location.path().replace(/\/$/, '');

// TODO: We need to do some munging of the path for different versions of the API...


$window.location = version.docsUrl + currentPagePath;
var currentPagePath = $location.path().replace(/\/$/, ''),
url = '';
if (version.isOldDocsUrl) {
url = version.docsUrl;
}else{
url = version.docsUrl + currentPagePath;
}
$window.location = url;
};
}]);
8 changes: 7 additions & 1 deletion lib/versions/version-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,16 @@ var getPreviousVersions = function() {
})
.filter()
.map(function(version) {
// angular.js didn't follow semantic version until 1.20rc1
if ((version.major === 1 && version.minor === 0 && version.prerelease.length > 0) || (version.major === 1 && version.minor === 2 && version.prerelease[0] === 'rc1')) {
version.version = [version.major, version.minor, version.patch].join('.') + version.prerelease.join('');
version.raw = 'v' + version.version;
}
version.docsUrl = 'http://code.angularjs.org/' + version.version + '/docs';
// Versions before 1.0.2 had a different docs folder name
if (version.major < 1 || (version.major === 1 && version.minor === 0 && version.dot < 2)) {
if (version.major < 1 || (version.major === 1 && version.minor === 0 && version.patch < 2)) {
version.docsUrl += '-' + version.version;
version.isOldDocsUrl = true;
}
return version;
})
Expand Down