site_build | R Documentation |
Write HTML output from the site.R
file in a site project.
site_build(dir, file = "site.R", name = "index.html", variables = NULL,
options = list(), bundle_data = FALSE, bundle_package = FALSE,
bundle_libs = FALSE, libs_overwrite = FALSE, libs_base_only = FALSE,
remote_data_handler = TRUE, open_after = FALSE, aggregate = TRUE,
sparse_time = TRUE, force = FALSE, version = "stable", parent = NULL,
include_api = FALSE, endpoint = NULL, tag_id = NULL, serve = FALSE,
host = "127.0.0.1", port = 3000, verbose = TRUE)
site_start_server(dir, host = "127.0.0.1", port = 3000)
dir |
Path to the site project directory. |
file |
Name of the R file to build the site from. |
name |
Name of the HTML file to be created. |
variables |
A character vector of variable names to include from the data. If no specified, all variables are included. |
options |
A list with options to be passed to the site. These will be written to |
bundle_data |
Logical; if |
bundle_package |
Logical; if |
bundle_libs |
Logical; if |
libs_overwrite |
Logical; if |
libs_base_only |
Logical; if |
remote_data_handler |
Logical; if |
open_after |
Logical; if |
aggregate |
Logical; if |
sparse_time |
Logical; if |
force |
Logical; if |
version |
Version of the base script and stylesheet: |
parent |
Directory path or repository URL of a data site from which to use data, rather than using local data. |
include_api |
Logical; if |
endpoint |
URL of the served API. |
tag_id |
Google tag ID (in the form of |
serve |
Logical; if |
host |
The IPv4 address to listen to if |
port |
The port to listen on if |
verbose |
Logical; if |
Invisible path to the written file.
To initialize a site project, use init_site
.
## Not run:
# run from within a site project directory, initialized with `init_site()`
site_build(".")
# serve locally and view the site
site_build(".", serve = TRUE, open_after = TRUE)
## End(Not run)
## Not run:
# serve a site that has already been built
# from the parent directory of a "docs" directory to be served
site_start_server(".")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.