Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Create Blogs and Websites with R Markdown
blogdown is an R package that converts R Markdown documents into static websites, using Hugo as the default site generator and supporting Jekyll and Hexo as alternatives.
blogdown is an open-source R package developed by RStudio that provides a website output format for R Markdown. It takes R Markdown files — which can embed R code, automatically rendered graphics, tables, analysis results, and HTML widgets, as well as technical writing elements such as citations, footnotes, and LaTeX math — and generates a complete static website. The package defaults to Hugo, a fast open-source static site generator, but also works with Jekyll and Hexo. It is installed from CRAN with install.packages('blogdown').
theme argument of new_site().serve_site() function builds the site, opens it in a web browser, and automatically refreshes the page whenever you save Markdown or R Markdown files.remotes::install_github('rstudio/blogdown').To get started, run blogdown::new_site() in an empty directory; it creates a skeleton site, downloads a Hugo theme from GitHub, and adds sample content, then opens the site in a browser. Editing the sample hello-world.Rmd file triggers an automatic rebuild and browser refresh. For ongoing development, use blogdown::serve_site() rather than the command-line hugo server, because hugo server only understands plain Markdown and cannot build R Markdown files.
Install the stable version from CRAN by running install.packages('blogdown') in R. The development version can be installed from GitHub with remotes::install_github('rstudio/blogdown'), which requires the remotes package.
No, blogdown uses Hugo by default but also supports Jekyll and Hexo as alternative static site generators. The Hugo integration is the most mature, with automatic theme download and a large theme directory.
Yes, blogdown works without RStudio — you can create a site with new_site() and serve it with serve_site() from any R environment. RStudio only adds a convenient project wizard to set up the site structure.
hugo server for building the site?The command-line hugo server cannot process R Markdown files, so it will not render your R-based content. Always use blogdown::serve_site() to build and preview the site, as it triggers knitr and Hugo correctly.
