|
| 1 | +--- |
| 2 | +title: "Link Documentation to blogdown Static Directory" |
| 3 | +--- |
| 4 | + |
| 5 | +This documentation should only have to be done once. It creates a symbolic link from the Rfun website's static directory (blgodown's static directory) to the HTML documentation generated here by using RStudio's "Build website feature". |
| 6 | + |
| 7 | +```{r} |
| 8 | +library(fs) |
| 9 | +library(here) |
| 10 | +library(glue) |
| 11 | +``` |
| 12 | + |
| 13 | +```{r} |
| 14 | +dir_ls() |
| 15 | +``` |
| 16 | + |
| 17 | +```{r} |
| 18 | +#docstoo <- dir_create("docs2") |
| 19 | +#dir_copy("docs", here()) |
| 20 | +
|
| 21 | +here() |
| 22 | +
|
| 23 | +#file_copy("docs", "docs2") |
| 24 | +
|
| 25 | +#dir_copy("docs", "docs2") |
| 26 | +#dir_copy("docs", here("docs2")) |
| 27 | +
|
| 28 | +#dir_delete("docs2") |
| 29 | +
|
| 30 | +#here() |
| 31 | +
|
| 32 | +#dir_copy(here("docs"), here("docs2")) |
| 33 | +
|
| 34 | +up_1_dir <- ".." |
| 35 | +dir_blogdown_target <- "blogdown2-rfun" |
| 36 | +dir_blogdown_static_target <- "static" |
| 37 | +dir_map_docs_target <- "map" |
| 38 | +
|
| 39 | +target_dircopy_location <- glue(up_1_dir, |
| 40 | + dir_blogdown_target, |
| 41 | + dir_blogdown_static_target, |
| 42 | + dir_map_docs_target, |
| 43 | + .sep = "/") |
| 44 | +
|
| 45 | +#target_dircopy_location |
| 46 | +here(target_dircopy_location) |
| 47 | +
|
| 48 | +#dir_copy(here("docs"), here(target_dircopy_location)) |
| 49 | +#file_move(here(target_dircopy_location, "docs"), |
| 50 | +# here(target_dircopy_location, "map")) |
| 51 | +
|
| 52 | +link_create(here("docs"), |
| 53 | + here(target_dircopy_location)) |
| 54 | +
|
| 55 | +``` |
| 56 | + |
0 commit comments