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,7 @@
});
}]);
function AppViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService, CookieService) {
function AppViewCtrl($scope, $routeParams, $rootScope, ApiService, UtilService) {
$scope.namespace = $routeParams.namespace;
$scope.name = $routeParams.name;
@ -29,8 +29,13 @@
};
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
$scope.repository = repo;
$scope.viewScope.repository = repo;
if (repo != undefined) {
$scope.repository = repo;
$scope.viewScope.repository = repo;
// Update the page description for SEO
$rootScope.description = UtilService.getFirstMarkdownLineAsString(repo.description);
}
});
};