update application and repository views to set <meta> description to improve search results

This commit is contained in:
Alec Merdler 2017-07-13 10:12:46 -04:00
parent 21ecc2eadd
commit a9c2ea608d
7 changed files with 65 additions and 52 deletions

View file

@ -10,7 +10,8 @@
});
}]);
function RepoViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService, CookieService) {
function RepoViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService,
UserService, AngularPollChannel, ImageLoaderService, UtilService) {
$scope.namespace = $routeParams.namespace;
$scope.name = $routeParams.name;
@ -59,22 +60,22 @@
};
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
$scope.repository = repo;
$scope.viewScope.repository = repo;
$scope.publicRepoExperiment = CookieService.get('quay.public-repo-exp') == 'true';
if (repo != undefined) {
$scope.repository = repo;
$scope.viewScope.repository = repo;
// Flag for new repo page experiment
$scope.newRepoExperiment = $scope.repository.is_public && $scope.user.username != $scope.repository.namespace && $scope.publicRepoExperiment;
// Update the page description for SEO
$rootScope.description = UtilService.getFirstMarkdownLineAsString(repo.description);
// Load the remainder of the data async, so we don't block the initial view from
// showing.
$timeout(function() {
$scope.setTags($routeParams.tag);
// Load the remainder of the data async, so we don't block the initial view from showing
$timeout(function() {
$scope.setTags($routeParams.tag);
// Track builds.
buildPollChannel = AngularPollChannel.create($scope, loadRepositoryBuilds, 30000 /* 30s */);
buildPollChannel.start();
}, 10);
// Track builds.
buildPollChannel = AngularPollChannel.create($scope, loadRepositoryBuilds, 30000 /* 30s */);
buildPollChannel.start();
}, 10);
}
});
};