Better version ordering of documentation
This commit is contained in:
parent
5e03d5bb06
commit
2044931cbe
@ -36,7 +36,7 @@
|
|||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<a class="list-group-item" ng-repeat="version in data | orderBy:versionOrder:true"
|
<a class="list-group-item" ng-repeat="version in data | orderBy:versionOrder:true"
|
||||||
href="./{{version}}/index.html">
|
href="./{{version}}/index.html">
|
||||||
{{normalizeVersion(version)}}
|
{{normalizeVersionDisplay(version)}}
|
||||||
</a>
|
</a>
|
||||||
</ul>
|
</ul>
|
||||||
</article>
|
</article>
|
||||||
@ -54,10 +54,14 @@
|
|||||||
.controller('docVersions', function ($scope, $http) {
|
.controller('docVersions', function ($scope, $http) {
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
|
|
||||||
$scope.normalizeVersion = function(v) {
|
$scope.normalizeVersionDisplay = function(v) {
|
||||||
return v.replace(/^v/, '');
|
return v.replace(/^v/, '');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.normalizeVersion = function(v) {
|
||||||
|
return v.replace(/^v/, '').replace(/^rust-/, '');
|
||||||
|
};
|
||||||
|
|
||||||
$scope.versionOrder = function(v) {
|
$scope.versionOrder = function(v) {
|
||||||
if (v === 'master') { return Infinity; }
|
if (v === 'master') { return Infinity; }
|
||||||
if (v === 'current') { return Number.MAX_VALUE; }
|
if (v === 'current') { return Number.MAX_VALUE; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user