deploy_pkgdown_site | R Documentation |
Copies the static pkgdown website files to another local Git folder, then stages, commits and pushes the changes. Use
pkgdown::build_site()
before running this function in order to create the website files.
Use this function with caution since by default it – except for the paths listed in never_clean
– completely wipes the to_path
directory!
deploy_pkgdown_site(
pkg_path = ".",
to_path = NULL,
use_dev_build = NULL,
clean_to_path = TRUE,
never_clean = paths_to_keep,
branch = NULL,
commit_msg = paste0("auto-deploy pkgdown site for ", desc::desc_get_field(file =
pkg_path, key = "Package")),
quiet = FALSE
)
pkg_path |
Path to the R package of which the pkgdown website files are to be deployed. |
to_path |
Path to the Git (sub)folder to which the pkgdown website files are to be deployed. If |
use_dev_build |
Whether or not to deploy the development build of the pkgdown website files. If |
clean_to_path |
Whether or not to wipe |
never_clean |
A character vector of paths relative to
|
branch |
The name of the Git branch to which the static website files are to be committed. A character scalar or |
commit_msg |
The Git commit message used for the deployment. A character scalar. |
quiet |
Whether or not to suppress printing status output from internal processing. |
This function is registered as an RStudio add-in, allowing RStudio users to assign a custom shortcut to it and to invoke it from the command palette.
A vector of paths to the deployed files/folders, invisibly.
to_path
via R optionsInstead of directly providing a valid to_path
argument, you can also set to_path = NULL
and provide
the desired deploy paths for each package in the R option yay.local_pkgdown_deploy_paths
. The value of this option must be a named character vector
whereas the names correspond to the package names and the values to the filesystem paths. As an example:
options(yay.local_pkgdown_deploy_paths = c(some_pkg = "/path/to/common_pkgdown_repo/some_pkg", another_pkg = "/path/to/common_pkgdown_repo/another_pkg", foo_pkg = "/path/to/dedicated_foo_pkgdown_repo"))
a default parent path in the R option yay.default_local_pkgdown_deploy_parent_path
that will be used as the deployment parent directory for all packages
that are not explicitly listed in yay.local_pkgdown_deploy_paths
. For example you could set
options(yay.default_local_pkgdown_deploy_parent_path = "/path/to/common_pkgdown_repo")
which would result in deploying the pkgdown website files of a hypothetical package named bar_pkg to /path/to/common_pkgdown_repo/bar_pkg
.
A suitable place to define the above options is the .Rprofile
file
in the user's home directory.
Other Git repository functions:
deploy_static_site()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.