Hannah Wang
Hannah Wang

Reputation: 35

Unable to render new .Rmd files to html after the recent blogdown update

I have a large site built on blogdown. Every day, there are several new .Rmd files that need to be rendered to html files. Before this recent blogdown update, I relied on serve_site() to render the new .Rmd files. After the update, as mentioned in the "release notes", we wouldn't need to call serve_site() explicitly; however, if I didn't call serve_site(), I cannot seem to get the html files rendered, and cannot preview the site in Rstudio. The public/ did not get updated either. (Even if I call serve_site(), I still cannot get the html files rendered...)

I noticed that blogdown::build_site(build_rmd = TRUE) can render all rmd files, but I don't want to rebuild the whole site. I wondered if I miss anything, or is there a way that I can only get the new .Rmd files render to html and copied to the public/ directory automatically in this new version? Thank you so much!

R session info

Upvotes: 3

Views: 454

Answers (2)

Yihui Xie
Yihui Xie

Reputation: 30114

With the latest version of blogdown on CRAN, serve_site() is called automatically when you open the RStudio project. If you add new Rmd files after that, they should be compiled automatically, but if you add them before you open the RStudio project, or call serve_site(), they won't be recognized. You can install the development version of blogdown (in which I just pushed a change), and these new Rmd files should be automatically compiled when you serve_site():

remotes::install_github('rstudio/blogdown')

Upvotes: 1

Davide Lorino
Davide Lorino

Reputation: 915

The quickest fix is to revert to the previous version of blogdown until the bug is documented and/or fixed.

I would recommend reverting using the versions package, it makes the process quite painless.

https://cran.r-project.org/web/packages/versions/versions.pdf

Best of luck!

Upvotes: 1

Related Questions