-
Notifications
You must be signed in to change notification settings - Fork 0
/
team.Rmd
117 lines (92 loc) · 2.63 KB
/
team.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
title: 'CUBE Reseach Team'
output:
html_document:
theme:
version: 4
css: team.css
self_contained: true
---
<!-- Google tag (gtag.js) for analytics -->
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-8F9R0B5L51"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-8F9R0B5L51');
</script>
<link rel=“stylesheet” type=“text/css” href=“team.css”>
</head>
```{r setup, include=F}
set.seed(124)
knitr::opts_chunk$set(
message = FALSE,
warning = FALSE,
echo = FALSE,
include = TRUE,
comment = "#>",
collapse = TRUE
)
```
```{r results='asis'}
library(googlesheets4)
library(dplyr)
googlesheets4::gs4_deauth()
data_url <- 'https://docs.google.com/spreadsheets/d/1zSHLGGOSBIOgN3BXXGl2jPtJLBF6OExAznjqmRnzrTY/edit?usp=sharing'
team <- googlesheets4::read_sheet(data_url, sheet = 'team') |>
dplyr::mutate(
img = paste0('public/img/team/', path_to_pic)
)
alumni <- googlesheets4::read_sheet(data_url, sheet = 'alumni') |>
dplyr::mutate(
img = paste0('public/img/team/', path_to_pic)
)
make_card <- function(img, name, bio){
glue::glue('
<div class=" team-card card bg-transparent border-0">
<div class="team-card-col card-body m-0 p-0 col-12">
<div class="team-card-row row no-gutters h-100 border-1 d-flex flex-wrap">
<div class="team-pic-container col-3 col-sm container-fluid" >
<img src="{img}" class="team-pic card-img"/>
</div>
<div class="col-9 h-100" style="justify: center; margin: auto">
<h5 class="card-title my-auto px-3 pt-3 pb-1">
{name}
</h5>
<p class="card-text my-auto px-3 pb-3 pt-1">{bio}</p>
</div>
</div>
</div>
</div>')
}
cards <- function(data) {
data |>
dplyr::mutate(html = purrr::pmap(
.l = list(img, name, bio),
.f = \(img, name, bio) make_card(img, name, bio)
)) |>
pull(html) |>
stringr::str_remove_all('\n') |>
paste0('')
}
```
------------------------------------------------
::: {style="align: center; margin: auto"}
```{r results='asis'}
# cat out html into document
team |> cards() |> cat()
```
:::
<br>
------------------------------------------------
<br>
## CUBE Alumni
The CUBE group wishes to recognize the excellent work of these former members of our research team who helped greatly in making our efforts a success.
::: {style="align: center; margin: auto"}
```{r results='asis'}
# cat out html into document
alumni |> cards() |> cat()
```
:::
------------------------------------------------