-
Notifications
You must be signed in to change notification settings - Fork 6
/
_team_member.Rmd
60 lines (43 loc) · 1.22 KB
/
_team_member.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
```{r}
# From https://distillery.rbind.io/posts/2021-03-24-customizing-distill-with-htmltools-and-css/
make_icon <- function(icon) {
return(htmltools::tag("i", list(class = icon)))
}
make_icon_text <- function(icon, text) {
return(htmltools::HTML(paste0(make_icon(icon), " ", text)))
}
icon_link <- function(icon = NULL, text = NULL, url = NULL) {
if (!is.null(icon)) {
text <- make_icon_text(icon, text)
}
return(htmltools::a(href = url, text, class = "icon-link"))
}
```
```{r}
title <- "{{name}}"
if ("{{webpage}}" != "") {
title <- htmltools::a(title, "href" = "{{webpage}}")
}
if ("{{github}}" != "") {
title <- paste(title, icon_link("bi bi-github", url = "https://github.com/{{github}}"))
}
if ("{{twitter}}" != "") {
title <- paste(title, icon_link("bi bi-twitter", url = "https://twitter.com/{{twitter}}"))
}
if ("{{orcid}}" != "") {
title <- paste(title, icon_link("ai ai-orcid", url = "https://orcid.org/{{orcid}}"))
}
```
### `r title`
:::: {style="display: grid; grid-template-columns: 1fr 3fr; grid-column-gap: 15px;"}
::: {class=profile-pic}
```{r, echo = FALSE}
if ("{{github}}" != "") {
knitr::include_graphics(gh::gh("/users/{{github}}")$avatar_url)
}
```
:::
::: {}
{{ description }}
:::
::::