How to prevent blogdown from rerendering all posts?

前端 未结 2 1942
终归单人心
终归单人心 2020-12-19 00:33

Background:

I am featuring a blog built on @YihuiXie\'s R package blogdown.

Problem:

When I render_site()

相关标签:
2条回答
  • 2020-12-19 00:57

    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.

    0 讨论(0)
  • 2020-12-19 01:08

    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:

    1. You should rarely need bookdown::render_site(). You can see that I didn't even mention this function in Section 1.7.

    2. 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.

    3. 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.

    0 讨论(0)
提交回复
热议问题