|
| 1 | +content_rmd <- list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE) |
1 | 2 |
|
2 | 3 | file.remove(
|
3 | 4 | gsub(
|
4 |
| - ".Rmd",".html", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE) |
| 5 | + ".Rmd",".html", content_rmd |
5 | 6 | )
|
6 | 7 | )
|
7 | 8 |
|
8 | 9 | lapply(
|
9 |
| - list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE), function(i){ |
| 10 | + content_rmd, function(i){ |
10 | 11 | print(sprintf("Rendering %s", i))
|
11 |
| - rmarkdown::render(i, envir = new.env()) |
| 12 | + knitr::knit(i, envir = new.env(), output = gsub(".Rmd", ".md", i)) |
12 | 13 | })
|
13 | 14 |
|
14 | 15 | file.remove(
|
15 | 16 | gsub(
|
16 |
| - ".Rmd",".html", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE) |
| 17 | + ".Rmd",".html", content_rmd |
17 | 18 | )
|
18 | 19 | )
|
19 | 20 |
|
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +Sys.setenv(HUGO_IGNOREERRORS = "error-remote-getjson", |
| 25 | + HUGO_BASEURL = "/", |
| 26 | + #HUGO_BASEURL = "https://linogaliana-teaching.netlify.app/", |
| 27 | + HUGO_RELATIVEURLS = "false", |
| 28 | + BLOGDOWN_POST_RELREF = "true", |
| 29 | + BLOGDOWN_SERVING_DIR = here::here()) |
| 30 | + |
| 31 | +cmd = blogdown:::find_hugo() |
| 32 | +cmd_args = c("--themesDir themes", "-t github.com")#, "--gc")#, "--minify") |
| 33 | +system2(cmd, cmd_args) |
| 34 | + |
| 35 | + |
| 36 | +#blogdown::stop_server() |
| 37 | + |
| 38 | + |
| 39 | +# Sys.setenv(HUGO_RELATIVEURLS = "true", |
| 40 | +# BLOGDOWN_POST_RELREF = "true") |
| 41 | + |
| 42 | +# cmd = blogdown:::find_hugo() |
| 43 | + |
| 44 | +#blogdown:::create_shortcode('postref.html', 'blogdown/postref', TRUE) |
| 45 | + |
| 46 | +# cmd_args = c("--themesDir themes", "-t github.com")#, "--gc")#, "--minify") |
| 47 | +# system2(cmd, cmd_args) |
| 48 | + |
| 49 | +#blogdowntest::serve_site() |
| 50 | + |
20 | 51 | # file.remove(
|
21 | 52 | # gsub(
|
22 | 53 | # ".Rmd",".md", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE)
|
23 | 54 | # )
|
24 | 55 | # )
|
| 56 | + |
| 57 | +# file.remove( |
| 58 | +# gsub( |
| 59 | +# ".Rmd",".ipynb", list.files("./content", recursive = TRUE, pattern = "*.Rmd", full.names = TRUE) |
| 60 | +# ) |
| 61 | +# ) |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
0 commit comments