Skip to content

RStudio & RMarkdown Guide

R users can publish to HugoBlox with RMarkdown in RStudio. The recommended path is to render .Rmd to plain Markdown and let Hugo handle the site. Blogdown is a fallback only if you must.

Section titled “Recommended: Render to Markdown (no blogdown)”
  • Install rmarkdown:
    install.packages("rmarkdown")
  • Add to your .Rmd frontmatter (or set in the rmarkdown::render call):
    output: md_document
  • Render your file:
    rmarkdown::render("input.Rmd", rmarkdown::md_document())
  • Place the generated .md in your Hugo content (e.g., content/post/my-analysis/index.md with images in the same folder or assets/media).
  • Run your usual Hugo workflow (hugo server via the CLI or the Visual Builder).
  • Compatibility: blogdown has lagged modern Hugo features and can corrupt config paths (e.g., config/_default) and Hugo Modules.
  • Extra complexity: adds another build step and can mask Hugo errors.
  • Ownership: blogdown competes with Hugo for the HTML rendering pipeline; keeping Hugo in control prevents double-processing and keeps your site output consistent and debuggable.
Section titled “If you must use blogdown (not recommended)”
  1. Install blogdown (latest)

    remotes::install_github("rstudio/blogdown")
  2. Open your site Open the project in RStudio; expect blogdown to flatten config/_default into project root (a known limitation).

  3. Create content

    blogdown::new_post(title = "My Analysis", ext = ".Rmd")
  4. Serve Use Addins → Serve Site (runs blogdown:::serve_site()).

  • Prefer .Rmarkdown over .Rmd if you want Hugo to own the HTML rendering.
  • Keep image paths relative and web-safe; store in page bundles or assets/media.
  • Avoid the dated embedded RStudio browser for previews; use a real browser on the hugo server URL.

Last updated: