fuse_site: Fuse R Markdown documents individually under a directory

View source: R/site.R

fuse_siteR Documentation

Fuse R Markdown documents individually under a directory

Description

Run fuse() on R Markdown documents individually to generate a website.

Usage

fuse_site(input = ".")

Arguments

input

The root directory of the site, or a vector of input file paths.

Details

If a directory contains a config file ⁠_litedown.yml⁠, which has a YAML field site, the directory will be recognized as a site root directory. The YAML field output will be applied to all R Markdown files (an individual R Markdown file can provide its own output field in YAML to override the global config). For example:

---
site:
  rebuild: "outdated"
  pattern: "[.]R?md$"
output:
  html:
    meta:
      css: ["@default"]
      include_before: "[Home](/) [About](/about.html)"
      include_after: "© 2024 | [Edit]($input$)"
---

The option rebuild determines whether to rebuild .Rmd files. Possible values are:

  • newfile: Build an input file if it does not have a .html output file.

  • outdated: Rebuild an input file if the modification time of its .html output file is older than the input.

Value

Output file paths (invisibly).

Examples

# create a minimal book example in the temp dir
d = tempfile()
litedown:::proj_skeleton(d, "site")
fuse_site(d)
if (interactive()) browseURL(file.path(d, "index.html"))
# clean up
if (xfun::is_R_CMD_check()) unlink(d, recursive = TRUE)

litedown documentation built on July 11, 2026, 9:07 a.m.