How to Prevent Blogdown from Rerendering All Posts

How to prevent blogdown from rerendering all posts?

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.

Why does blogdown keep rebuilding RMarkdown files?

You did not follow the recommended workflow. You do not have to, but then you will have to read the documentation more carefully to understand what blogdown::build_site() actually does. The same question has been asked on Github.

Prevent re-knitting of old rmd files when publishing blogdown website on shared server

Basically I'm repeating the documentation and my answer in the post you mentioned:

  1. Do not use blogdown::build_site() (again, you rarely need to use this function).

  2. Use blogdown::serve_site() to (continuously) preview the site.

  3. When you are ready to publish the site, run blogdown::hugo_build(), and publish the public/ directory.

I hope it is clear this time.

Blogdown category pages are showing all posts regardless of category

This is a bug of the theme (the list was hardcoded to show all posts of a site), and I just fixed it on Github. You can try to reinstall the theme: https://github.com/yihui/hugo-lithium-theme

rendering `.Rmd` posts as slides in blogdown

This use case is documented in the second half of Section 2.7 of the blogdown book. Basically, you have to

  1. Put this Rmd document under static/;

  2. Add a script R/build.R.

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

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')

Inline html deleted from blogdown page

This is likely a side effect of Hugo adopting Goldmark as the default Markdown rendering library. This was introduced in Hugo v0.60.

To have the Goldmark renderer emit HTML embedded in your Markdown add the following to your site config. This comes from the Hugo release notes linked above:

[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true

Using this setting in a test site with your html and the ananke theme used in the initial Hugo walkthrough produced a link as expected with transformed markdown around it.



Related Topics



Leave a reply



Submit