config_netlify | R Documentation |
This function provides some default configurations for a Huge website to be built via Hugo and deployed on Netlify. It sets the build command for the production and preview contexts, respectively (for preview contexts such as ‘deploy-preview’, the command will build future posts). It also sets the publish directory according to your setting in Hugo's config file (if it exists, otherwise it will be the default ‘public’ directory). The Hugo version is set to the current version of Hugo found on your computer.
config_netlify(output = "netlify.toml", new_config = list())
output |
Path to the output file, or |
new_config |
If any default configuration does not apply to your site,
you may provide a list of configurations to override the default. For
example, if you want to use Hugo v0.25.1, you may use |
If output = NULL
, a character vector of TOML data representing
the configurations (which you can preview and decide whether to write it to
a file), otherwise the TOML data is written to a file.
See Netlify's documentation on the configuration file ‘netlify.toml’ for the possible settings: https://docs.netlify.com/configure-builds/file-based-configuration/
blogdown::config_netlify(output = NULL) # default data
# change the publish dir to 'docs/'
blogdown::config_netlify(NULL, list(build = list(publish = "docs")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.