diff --git a/DESCRIPTION b/DESCRIPTION index fa27c24..a7d9612 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rmdgallery Title: R Markdown Website Gallery Generator -Version: 0.2.1 +Version: 0.2.2 Authors@R: person(given = "Riccardo", family = "Porreca", diff --git a/NEWS.md b/NEWS.md index 63324ae..3a19c06 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# rmdgallery 0.2.2 + +## Patch release + +- The `gallery_site()` generator now works when `rmarkdown::render_site()` is called with any path to a directory containing the website sources (#11). + # rmdgallery 0.2.1 ## Patch release diff --git a/R/gallery_site_generator.R b/R/gallery_site_generator.R index 159593b..c0f2595 100644 --- a/R/gallery_site_generator.R +++ b/R/gallery_site_generator.R @@ -121,7 +121,8 @@ gallery_site <- function(input, ...) { if (!quiet) message("\nMetadata from: ", meta$.meta_file) # gallery config: meta$gallery_config <- if (is.null(config$gallery)) list() else config$gallery - output_file <- file.path(input, file_with_ext(name, "html")) + output_file <- name # extension and directory are included by rmarkdown::render + x <- file.path(input, file_with_ext(sprintf(".tmp_%s", name), "Rmd")) template_dir <- if (!is.null(config$gallery$template_dir)) { file.path(input, config$gallery$template_dir) @@ -134,9 +135,9 @@ gallery_site <- function(input, ...) { # make some useful utils available when rendering envir <- list2env(render_time_utils, parent = envir) - output <- render_one(input = x, - output_format = output_format, output_file = output_file, + output_format = output_format, + output_file = output_file, output_options = list(lib_dir = "site_libs", self_contained = FALSE), params = knit_params,