-
Notifications
You must be signed in to change notification settings - Fork 4
/
.Rprofile
35 lines (32 loc) · 1.06 KB
/
.Rprofile
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
if (file.exists('~/.Rprofile')) {
sys.source('~/.Rprofile', envir = environment())
}
options(
blogdown.hugo.version = "0.89.1",
blogdown.generator.server = TRUE,
blogdown.author = "Garrick Aden-Buie",
blogdown.subdir = strftime(Sys.time(), "blog/%Y"),
blogdown.ext = ".Rmd",
blogdown.hugo.server = c('-D', '-F', '--navigateToChanged'),
repos = c(
gadenbuie = "https://gadenbuie.r-universe.dev",
CRAN = "https://cloud.r-project.org"
)
)
# General Blog Helpers ----
lightbox_img <- function(url, alt = "", caption = "", preview = TRUE, img_extra = "") {
if (preview) {
description <- ""
if (nzchar(caption)) {
description <- glue::glue(' description="{caption}"')
}
if (nzchar(img_extra)) {
img_extra <- paste0(" ", trimws(img_extra))
}
glue::glue('![{alt}]({url}){{.lightbox{description}{img_extra}}}')
} else {
if (alt == "") alt <- "static image of the plot"
if (nzchar(caption)) caption <- glue::glue(' data-description="{caption}"')
glue::glue('<a href="{url}" class="lightbox"{caption}>{alt}</a>')
}
}