/
build_light.R
57 lines (37 loc) · 1.14 KB
/
build_light.R
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
content_rmd <- list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
content_rmd <- content_rmd[!grepl("/git/", content_rmd)]
content_rmd <- content_rmd[!grepl("06a_exo_supp_webscraping.", content_rmd)]
content_rmd <- content_rmd[5]
file.remove(
gsub(
".Rmd",".html", content_rmd
)
)
lapply(
content_rmd, function(i){
print(sprintf("Rendering %s", i))
knitr::knit(i, envir = new.env(), output = gsub(".Rmd", ".md", i))
})
file.remove(
gsub(
".Rmd",".html", content_rmd
)
)
#blogdown::stop_server()
# Sys.setenv(HUGO_RELATIVEURLS = "true",
# BLOGDOWN_POST_RELREF = "true")
# cmd = blogdown:::find_hugo()
#blogdown:::create_shortcode('postref.html', 'blogdown/postref', TRUE)
# cmd_args = c("--themesDir themes", "-t github.com")#, "--gc")#, "--minify")
# system2(cmd, cmd_args)
#blogdowntest::serve_site()
# file.remove(
# gsub(
# ".Rmd",".md", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
# )
# )
# file.remove(
# gsub(
# ".Rmd",".ipynb", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
# )
# )