hugo_start: Manage the hugo server

Description Usage Arguments Hugo version

View source: R/hugo-server.R

Description

hugo_start() starts a hugo server that will automatically re-generate the site whenever the input changes. You only need to execute this once per session; it continues to run in the background as you work on the site. For large sites the hugo server can be slow to start; if it takes longer than 30 seconds hugo_start() throws an error.

hugo_stop() kills the server. This happens automatically when you exit R so you shouldn't normally need to run this.

hugo_browse() opens the site in the RStudio viewer or your web browser.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
hugo_start(
  site = ".",
  auto_navigate = TRUE,
  browse = TRUE,
  render_to_disk = FALSE,
  port = 1313
)

hugo_stop()

hugo_browse()

Arguments

site

Path to hugo site.

auto_navigate

Automatically navigate to the most recently changed page?

browse

Automatically preview the site after the server starts?

render_to_disk

Render site to disk? The default is to serve the site from memory, but rendering to disk can be helpful for debugging.

port

Port to run server on. For advanced use only.

Hugo version

hugodown will attempt to automatically use the correct version of hugo for your site (prompting you to call hugo_install() if needed). It looks in two places:

This means if you already use netlify, hugodown will automatically match the version of hugo that you're using for deployment.


r-lib/hugodown documentation built on Feb. 1, 2021, 6:47 a.m.