-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_site.R
More file actions
193 lines (134 loc) · 5.56 KB
/
build_site.R
File metadata and controls
193 lines (134 loc) · 5.56 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
## generate fickse.github.io
library(readxl)
generate_page <- function(pagename, title, subtitle = '', headerimage = 'images/Banner.png'){
header <- readLines('html/basic.html')
page <- gsub('<!--PAGENAME-->', pagename, header)
navbar <- paste(readLines('html/navbar.html'), collapse = '\n')
navbar <- gsub('<!--HEADERIMAGE-->', headerimage, navbar)
navbar <- gsub('<!--TITLE-->', title, navbar)
page <- gsub('<!--NAVBAR-->', navbar, page)
return(page)
}
##################
## make index page
#idx = generate_page('Steve Fick', 'STEVE FICK', 'Geospatial Data Scientist', 'images/background.jpg')
idx = generate_page('Steve Fick', 'STEVE FICK', 'Geospatial Data Scientist')
## index page content
idx_content = '
<div class="w3-content w3-padding-large" id="portfolio">
<div class="main">
<div id="greeter">
<div class="textbox">
<!-- <h1> Steve Fick </h1> <br> -->
I develop tools and datasets for evidence-based decision making. My areas of specialization include environmental modeling, data science, spatial ecology, and restoration ecology.
<br><br>
</div>
<img class="avatar" src="images/steve2bwborder.JPG" alt="Me"><br>
</div>
<a href="https://scholar.google.com/citations?user=Y4h2OOoAAAAJ&hl=en">
<i class="ai ai-google-scholar ai-1x"></i></a>
<a href="https://github.com/fickse"<i class="fa fa-github fa-4"></i></a> <a href="https://fickse.wordpress.com/">blog</a>
<a href="https://www.linkedin.com/in/steve-fick-334652195/"> linkedin </a>
<a href="https://orcid.org/0000-0002-3548-6966"><i class="ai ai-orcid ai-1x"></i></a></div>
</div>
</div>
'
idx = gsub('<!--CONTENT-->', idx_content, idx)
cat(idx, file = 'index.html', sep = '\n')
########################
## Make Publications page
pubs = generate_page('Publications', 'PUBLICATIONS')
## generate publications content
pp = as.data.frame(read_excel('RESUME.xlsx', sheet = 3))
strings <- ''
pp <- pp[rev(order(pp$Year)),]
for ( i in 1:nrow(pp)){
f <- file.path('files',pp$pdf[i])
string <- paste0('<li><a href=', f, '.pdf>', pp$Citation[i], '</a>')
strings <- c(strings, string)
}
prefix = '
<div class="w3-content w3-padding-large w3-margin-top" id="portfolio">
<div class="main">
<div style="padding-left:1.5em;text-indent:-2.5em;font-size:15px;color:#af5454">
'
suffix = '</div>
</div>
</div>
'
strings <- paste(strings, collapse = '\n')
strings <- paste0(prefix, strings, suffix)
pubs <- gsub('<!--CONTENT-->', strings, pubs)
cat( pubs, file = 'publications.html', sep = '\n')
###########################
## Make CV page
cv <- generate_page('CV', 'CURRICULUM VITAE')
cv_content = '
<div class="w3-content w3-padding-large w3-margin-top" id="portfolio">
<!-- Images (Portfolio) -->
<embed class="cv" src="assets/cv.pdf" width="800px" height="2100px" />
</div>
'
cv <- gsub('<!--CONTENT-->', cv_content, cv)
cv <- paste(cv, collapse = '\n')
cat( cv, file = 'cv.html', sep = '\n')
###########################
## Make Projects Page
proj <- generate_page('projects', 'PROJECTS')
add_content <- function(img, text){
glue::glue('
<div id="greeter">
<img src="{img}" alt="thumb" class="avatar"></img>
<div class="textbox">
{text}<br><br>
</div>
</div>
')
}
projects = list(
list(
"img" = "images/thumb.PNG",
"text" = "Using geospatial data and historical records to evaluate conservation and restoration practice effectiveness across the Upper Colorado River Basin"
),
list(
"img" = "images/thumb_ic.jpg",
"text" = 'Working with <a href="https://www.zekebaker.com/projects">social scientists</a> to study how <a href="https://sciencemoab.org/climbersplace/">rock climbers at Indian Creek</a> (Bears Ears) evaluate their cultural and ecological impacts in the context of land-use conflict, new technologies and the burgeoning growth of the outdoor recreation industry.'
),
list(
"img" = "images/704_2016_b.jpg",
"text" = 'Testing <a href="https://www.usgs.gov/centers/sbsc/science/new-approaches-restoring-colorado-plateau-grasslands?qt-science_center_objects=0#qt-science_center_objects">novel restoration practices</a> for degraded arid lands with field experiments.'
),
list(
"img" = "images/trase.PNG",
"text" = 'Linking consumers, exporters, and production geographies in the global trade of forest-risk commodities with a <a href="https://www.trase.earth">supply-chain traceability tool</a> (trase).'
),
list(
"img" = "images/WC2.PNG",
"text" = '<a href="http://worldclim.org/version2">WorldClim 2</a>: A global climatology dataset updated with data from new stations and satellite archives'
)
)
proj_content <- c('
<div class="w3-content w3-padding-large w3-margin-top" id="portfolio">
<div class="main">')
for (p in projects){
proj_content = c(proj_content, add_content( p$img, p$text))
}
proj_content <- c(proj_content, '</div></div>')
proj_content = paste(proj_content, collapse = ' ')
proj <- gsub('<!--CONTENT-->', proj_content, proj)
proj <- paste(proj, collapse = '\n')
cat( proj, file = 'projects.html', sep = '\n')
###########################
## Make Photography page
photo <- generate_page('photography', 'PHOTOGRAPHY')
photo_content <- '
<br>
<img src="images/colorado.JPG" class="photo"/>
<img src="images/tilden.JPG" class="photo"/>
<img src="images/balanced.jpg" class="photo"/>
<img src="images/sierra.png" class="photo"/>
'
photo <- gsub('<!--CONTENT-->', photo_content, photo)
photo <- gsub('<body>', '<body style="background-color:black;">', photo)
photo <- paste(photo, collapse = '\n')
cat( photo, file = 'photography.html', sep = '\n')