C.1 More global options

There are a few more advanced global options in addition to those introduced in Section 1.4, and they are listed in Table C.1.

TABLE C.1: A few more advanced global options.
Option name Default Meaning
blogdown.hugo.dir the directory of the Hugo executable
blogdown.method html the building method for R Markdown
blogdown.publishDir the publish dir for local preview
blogdown.widgetsID TRUE incremental ID’s for HTML widgets?

If you want to install Hugo to a custom path, you can set the global option blogdown.hugo.dir to a directory to store the Hugo executable before you call install_hugo(), e.g., options(blogdown.hugo.dir = '~/Downloads/hugo_0.20.1/'). This may be useful for you to use a specific version of Hugo for a specific website,32 or store a copy of Hugo on a USB Flash drive along with your website.

The option blogdown.method is explained in Section C.8.

When your website project is under version control in the RStudio IDE, it may be slow to preview the site continuously if it contains hundreds of files or more, because the default publish directory is public/ under the project root directory, and whenever you make a change in the source that triggers a rebuild, RStudio will be busy with tracking file changes in the public/ directory. The delay before you see the website in the RStudio Viewer can be more than 10 seconds or even longer. That is why we provide the option blogdown.publishDir. You may set a temporary publish directory to generate the website, and this directory should not be under the same RStudio project, e.g., options(blogdown.publishDir = '../public_site'), which means the website will be generated to the directory public_site/ under the parent directory of the current project.

The option blogdown.widgetsID is only relevant if your website source is under version control and you have HTML widgets on the website. If this option is TRUE (default), the random ID’s of HTML widgets will be changed to incremental ID’s in the HTML output, so that these ID’s are unlikely to change every time you recompile your website, otherwise every time you will get different random ID’s.


  1. You can set this option per project. See Section 1.4 for details.