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.
Recommended: Render to Markdown (no blogdown)
Section titled “Recommended: Render to Markdown (no blogdown)”- Install
rmarkdown:install.packages("rmarkdown") - Add to your
.Rmdfrontmatter (or set in thermarkdown::rendercall):output: md_document - Render your file:
rmarkdown::render("input.Rmd", rmarkdown::md_document())
- Place the generated
.mdin your Hugo content (e.g.,content/post/my-analysis/index.mdwith images in the same folder orassets/media). - Run your usual Hugo workflow (
hugo servervia the CLI or the Visual Builder).
Why avoid blogdown by default?
Section titled “Why avoid blogdown by default?”- 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.
If you must use blogdown (not recommended)
Section titled “If you must use blogdown (not recommended)”-
Install blogdown (latest)
remotes::install_github("rstudio/blogdown") -
Open your site Open the project in RStudio; expect blogdown to flatten
config/_defaultinto project root (a known limitation). -
Create content
blogdown::new_post(title = "My Analysis", ext = ".Rmd") -
Serve Use Addins → Serve Site (runs
blogdown:::serve_site()).
- Prefer
.Rmarkdownover.Rmdif 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 serverURL.