use_github_pages {usethis} | R Documentation |
Configure a GitHub Pages site
Description
Activates or reconfigures a GitHub Pages site for a project hosted on GitHub. This function anticipates two specific usage modes:
Publish from the root directory of a
gh-pages
branch, which is assumed to be only (or at least primarily) a remote branch. Typically thegh-pages
branch is managed by an automatic "build and deploy" job, such as the one configured byuse_github_action("pkgdown")
.Publish from the
"/docs"
directory of a "regular" branch, probably the repo's default branch. The user is assumed to have a plan for how they will manage the content below"/docs"
.
Usage
use_github_pages(branch = "gh-pages", path = "/", cname = NA)
Arguments
branch , path |
Branch and path for the site source. The default of
The most common alternative is to use the repo's default branch, coupled
with Note that GitHub does not support an arbitrary |
cname |
Optional, custom domain name. The Note that this can add or modify a CNAME file in your repository. If you are using Pages to host a pkgdown site, it is better to specify its URL in the pkgdown config file and let pkgdown manage CNAME. |
Value
Site metadata returned by the GitHub API, invisibly
See Also
-
use_pkgdown_github_pages()
combinesuse_github_pages()
with other functions to fully configure a pkgdown site
Examples
## Not run:
use_github_pages()
use_github_pages(branch = git_default_branch(), path = "/docs")
## End(Not run)