Download the appropriate Hugo executable for your platform from Github and
try to copy it to a system directory so blogdown can run the
hugo command to build a site.
install_hugo(version = "latest", extended = TRUE, force = FALSE, ...) update_hugo()
The Hugo version number, e.g.,
Whether to use extended version of Hugo that has SCSS/SASS support. You only need the extended version if you want to edit SCSS/SASS. Note that this feature is not available to Hugo version lower than v0.43. It also requires a 64-bit system; if the system is based on the ARM architecture, only macOS is supported at the moment.
Whether to reinstall Hugo if the specified version has been installed.
This function tries to install Hugo to
~/Library/Application Support on macOS, and
~/.local/share on other platforms (such as Linux). The
executable is installed to a subdirectory with the Hugo version number being
its name, e.g.,
~/Library/Application Support/Hugo/0.76.5. If these
directories are not writable, the R package directory
blogdown will be used. If it still fails, you have to install Hugo by
yourself and make sure it can be found via the environment variable
This is just a helper function and may fail to choose the correct Hugo executable for your operating system, especially if you are not on Windows or macOS or a major Linux distribution. When in doubt, read the Hugo documentation and install it by yourself: https://gohugo.io.
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
'~/Downloads/Hugo'). This may be useful for you to use a specific version of
Hugo for a specific website. You can set this option per project. See
Global options for details, or store a copy of Hugo on a USB Flash drive
along with your website.
For macOS users, you are not recommended to install Hugo via Homebrew, because you may accidentally update it to the latest version, which might break your existing sites.
remove_hugo() to remove Hugo.