Skip to content

Commit

Permalink
Auto merge of rust-lang#10876 - flip1995:gh-pages-cleanup-repo, r=fli…
Browse files Browse the repository at this point in the history
…p1995

Adapt versions.html file to cleaned up gh-pages

Companion PR to rust-lang#10875

changelog: Remove legacy v0.0.* versions from Clippy repository and documentation.

Must be merged together with rust-lang#10875 (best with a closed tree)

r? `@Alexendoo` (because you were randomly selected on the other PR :P)
  • Loading branch information
bors committed Jun 17, 2023
2 parents 3217f8a + 60b7fde commit baf3680
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions util/gh-pages/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3 class="panel-title">
<ul class="list-group">
<a class="list-group-item" ng-repeat="version in data | orderBy:versionOrder:true"
href="./{{version}}/index.html">
{{normalizeVersionDisplay(version)}}
{{version}}
</a>
</ul>
</article>
Expand All @@ -54,18 +54,15 @@ <h3 class="panel-title">
.controller('docVersions', function ($scope, $http) {
$scope.loading = true;

$scope.normalizeVersionDisplay = function(v) {
return v.replace(/^v/, '');
};

$scope.normalizeVersion = function(v) {
return v.replace(/^v/, '').replace(/^rust-/, '');
return v.replace(/^rust-/, '');
};

$scope.versionOrder = function(v) {
if (v === 'master') { return Infinity; }
if (v === 'stable') { return Number.MAX_VALUE; }
if (v === 'beta') { return Number.MAX_VALUE - 1; }
if (v === 'pre-1.29.0') { return Number.MIN_VALUE; }

return $scope.normalizeVersion(v)
.split('.')
Expand Down

0 comments on commit baf3680

Please sign in to comment.