Skip to content

Commit

Permalink
fix for metacran that has no name
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jun 1, 2024
1 parent d22a484 commit f44e63d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions static/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ function load_github_user_info(){
return github_api('/users/' + ghuser).then(function(user){
$("#github-user-name").text(user.name || ghuser);

// use same name->title format as GitHub itself
if(user.type === 'Organization'){
$("title.default-fallback-title").text(`R packages by ${user.name}`);
} else {
$("title.default-fallback-title").text(`R packages by ${ghuser} (${user.name})`);
if(user.name){
// use same name->title format as GitHub itself
if(user.type === 'Organization'){
$("title.default-fallback-title").text(`R packages by ${user.name}`);
} else {
$("title.default-fallback-title").text(`R packages by ${ghuser} (${user.name})`);
}
}

$("#github-user-bio").text(user.bio);
if(user.company){
$("#github-user-company").toggleClass("d-none").find('.content').text(user.company);
Expand Down

0 comments on commit f44e63d

Please sign in to comment.