How to prevent blogdown from rerendering all posts?

前端 未结 2 1961
终归单人心
终归单人心 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 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.

提交回复
热议问题