R Markdown has a simple website builder baked in (see the R Markdown book for a detailed description). An R Markdown website must have at least have an index.Rmd file and a _site.yml file (which can be empty). Including YAML in _site.yml will apply it to all R Markdown files for the website, e.g. setting the output format here will tell R Markdown to use that format across the website. R Markdown websites also support navbars, which you can specify with YAML (see yml_navbar(), as well as ?rmarkdown::render_site and ?rmarkdown::html_document). Pass navbar_page() to the left or right field to set up page tabs and use navbar_separator() to include a separators. In addition to writing YAML with yml_*() functions, use_site_yml() will take the a yml object and write it to a _site.yml file for you.

  name = yml_blank(),
  favicon = yml_blank(),
  output_dir = yml_blank(),
  include = yml_blank(),
  exclude = yml_blank(),
  new_session = yml_blank(),

  title = yml_blank(),
  type = yml_blank(),
  left = yml_blank(),
  right = yml_blank(),

  text = yml_blank(),
  href = yml_blank(),
  icon = yml_blank(),
  menu = yml_blank(),




a yml object created by yml(), as_yml(), or returned by a yml_*() function


The name of the website


Path to a file to use as the favicon


Directory to copy site content into ("_site" is the default if none is specified)

include, exclude

Files to include or exclude from the copied into output_dir. You can use * to indicate a wildcard selection, e.g. "*.csv".


Logical. Should each website file be rendered in a new R session?


additional named R objects, such as characters or lists, to transform into YAML


The title of the website


The color scheme for the navigation bar: either "default" or "inverse".

left, right

the side of the navbar a navbar_page() should go (see example)


The link text


The link URL


An icon to include


drop-down menus specified by including another navbar_page()


a yml object

See also


yml_empty() %>% yml_site_opts( name = "my-website", output_dir = "_site", include = "demo.R", exclude = c("docs.txt", "*.csv") ) %>% yml_navbar( title = "My Website", left = list( navbar_page("Home", href = "index.html"), navbar_page(navbar_separator(), href = "about.html") ) ) %>% yml_output(html_document(toc = TRUE, highlight = "textmate"))
#> --- #> name: my-website #> output_dir: _site #> include: demo.R #> exclude: #> - docs.txt #> - '*.csv' #> navbar: #> title: My Website #> left: #> - text: Home #> href: index.html #> - text: '---------' #> href: about.html #> output: #> html_document: #> toc: true #> highlight: textmate #> --- #>