diff --git a/.gitignore b/.gitignore index 852a3c27..f45322da 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /site_libs *.rmarkdown /.luarc.json +/tmp diff --git a/team/_rerender_contributors.R b/team/_rerender_contributors.R index 46e667fe..2ea571c5 100644 --- a/team/_rerender_contributors.R +++ b/team/_rerender_contributors.R @@ -57,8 +57,18 @@ render_author <- function(author) { email_clean <- tolower(stringr::str_trim(author$info$email)) checksum <- digest::digest(email_clean, algo = "md5", serialize = FALSE) paste0("https://www.gravatar.com/avatar/", checksum) - } else { + } else if (file.exists("/images/avatar.svg")){ "/images/avatar.svg" + } else { + # generate random avatar + name <- strsplit(author$name, " ") + url <- paste0("https://avatar.iran.liara.run/username?username=",name[[1]][[1]],"+",name[[1]][[2]]) + output_dir <- file.path("tmp", gsub(" ", "_", author$name)) + if (!dir.exists(output_dir)) { + dir.create(output_dir, recursive = TRUE) + } + download.file(url, file.path(output_dir, "avatar.png"), mode = "wb") + "avatar.png" } # process links @@ -174,6 +184,11 @@ for (task_name in names(tasks)) { } writeLines(txt, file_path) + + if (file.exists(file.path("tmp", gsub(" ", "_", author$name), "avatar.png"))) { + file.rename(file.path("tmp", gsub(" ", "_", author$name), "avatar.png"), file.path(dirname(file_path), "avatar.png")) + } + } } @@ -212,7 +227,10 @@ listing: template: members.ejs sort: '' ", paste(teams_headers, collapse = "\n"), " -css: team.css +css: + - team.css + - ../_site/site_libs/quarto-contrib/fontawesome6-0.1.0/all.css + - ../_site/site_libs/quarto-contrib/fontawesome6-0.1.0/latex-fontsize.css --- ## Core members diff --git a/team/index.qmd b/team/index.qmd index 2cfc6fe5..fe8bf886 100644 --- a/team/index.qmd +++ b/team/index.qmd @@ -60,9 +60,9 @@ listing: template: members.ejs sort: '' css: - - team.css - - ../_site/site_libs/quarto-contrib/fontawesome6-0.1.0/all.css - - ../_site/site_libs/quarto-contrib/fontawesome6-0.1.0/latex-fontsize.css + - team.css + - ../_site/site_libs/quarto-contrib/fontawesome6-0.1.0/all.css + - ../_site/site_libs/quarto-contrib/fontawesome6-0.1.0/latex-fontsize.css --- ## Core members diff --git a/team/task_contributors/spatially_variable_genes/guanao_yan/avatar.png b/team/task_contributors/spatially_variable_genes/guanao_yan/avatar.png new file mode 100644 index 00000000..58127be6 Binary files /dev/null and b/team/task_contributors/spatially_variable_genes/guanao_yan/avatar.png differ diff --git a/team/task_contributors/spatially_variable_genes/guanao_yan/index.qmd b/team/task_contributors/spatially_variable_genes/guanao_yan/index.qmd index 46a6bee5..9b6b04fd 100644 --- a/team/task_contributors/spatially_variable_genes/guanao_yan/index.qmd +++ b/team/task_contributors/spatially_variable_genes/guanao_yan/index.qmd @@ -1,6 +1,6 @@ --- title: Guanao Yan -image: /images/avatar.svg +image: avatar.png role: Author about: template: jolla