diff --git a/DESCRIPTION b/DESCRIPTION index fa034c07..3a81839e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: blogdown Type: Package Title: Create Blogs and Websites with R Markdown -Version: 0.20.20 +Version: 0.20.21 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person("Beilei", "Bian", role = "ctb"), diff --git a/R/render.R b/R/render.R index d77327b8..dff9c3b5 100644 --- a/R/render.R +++ b/R/render.R @@ -123,15 +123,21 @@ build_rmds = function(files) { if (file.copy(shared_yml, copy)) copied_yaml <<- c(copied_yaml, copy) } - out = NULL - for (f in files) { - d = dirname(f) - out = output_file(f, to_md <- is_rmarkdown(f)) + for (i in seq_along(files)) { + f = files[i]; d = dirname(f); out = output_file(f, to_md <- is_rmarkdown(f)) copy_output_yml(d) message('Rendering ', f, '... ', appendLF = FALSE) render_page(f) x = read_utf8(out) - x = encode_paths(x, by_products(f, '_files'), d, base, to_md) + x = encode_paths(x, lib1[2 * i - 1], d, base, to_md) + move_files(lib1[2 * i - 0:1], lib2[2 * i - 0:1]) + + # when serving the site, pause for a moment so Hugo server's auto navigation + # can navigate to the output page + if ((length(opts$get('served_dirs')) || isTRUE(opts$get('render_one')))) { + Sys.sleep(getOption('blogdown.build_rmds.wait', 2)) + } + if (to_md) { write_utf8(x, out) } else { @@ -142,12 +148,6 @@ build_rmds = function(files) { append(s, 'draft: yes', 1) }) } - # when serving the site, pause for a moment so Hugo server's auto navigation - # can navigate to the `out` page - if (!is.null(out) && (length(opts$get('served_dirs')) || isTRUE(opts$get('render_one')))) { - Sys.sleep(getOption('blogdown.build_rmds.wait', 2)) - xfun::process_file(out) - } message('Done.') } }