rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.73k stars 335 forks source link

build_site is always recompiling `.Rmd` files #109

Closed cboettig closed 7 years ago

cboettig commented 7 years ago

I'd thought if the .html that blogdown generates in the content/ dir had a more recent timestamp, but for some reason every time I run blogdown::build_site() it looks like it's re-knitting all my .Rmd files each time. Not sure what I've missed.

Here's one of my sites that shows this problem but still builds in a few seconds so might serve as a minimal reproducible example: https://github.com/codemeta/codemeta.github.io

yihui commented 7 years ago

If you use Netlify or other services that support Hugo, you won't need build_site() at all. All you need is serve_site() and push to Github. If you want to build the site by yourself and publish the public/ folder, here are the gory details: https://bookdown.org/yihui/blogdown/local-preview.html

cboettig commented 7 years ago

@yihui ah, whoops, I didn't realize build_site() disabled the caching behavior by default:

This caching mechanism does not apply to local = FALSE, i.e., build_site(local = FALSE) will always recompile all Rmd files, because when you want to publish a site, you may need to recompile everything to make sure the site is fully regenerated.

Yay! That makes so much sense!