Background:
I am featuring a blog built on @YihuiXie\'s R package blogdown
.
Problem:
When I render_site()
blogdown::serve_site()
tries to rerender some of my old blog posts after I reset my computer and re-downloaded the code from github.
By using blogdown:::build_rmds("content/post/{file_name}.Rmd")
I was able to render single Rmd files to html. To check the results I run hugo server
in the terminal window.
I think the answer is on the page you referenced -- Section 1.7 of the blogdown book ("A recommended workflow"). It seems it is not clear enough to you, so let me rephrase it:
You should rarely need bookdown::render_site()
. You can see that I didn't even mention this function in Section 1.7.
Use blogdown::serve_site()
, and it is the only function you need to call if your website is published on Netlify, or any servers that can run the hugo
command to build your website on the server side.
If you do not use Netlify, or do not call hugo
on the server side, but want to build the site locally and publish the public/
folder manually, call blogdown::hugo_build()
before you publish your website.
Since you are using Netlify, the answer is basically blogdown::serve_site()
. That is all you need. It does not re-render Rmd files that have not been changed. See the Appendix D.3.