README.md

hugodown

Lifecycle: experimental R-CMD-check Codecov test coverage

hugodown is an experimental package that aims to facilitate the use of RMarkdown and hugo together. It's similar to blogdown, but is focussed purely on Hugo websites, and enforces a stricter partitioning of roles: hugodown is responsible for transforming .Rmd to .md, and hugo is responsible for transforming .md to .html.

Compared to blogdown

Installation

hugodown isn't available from CRAN yet (and might never be), but you can install the development version from GitHub with:

devtools::install_github("r-lib/hugodown")

Usage

The key to using hugodown is to put output: hugodown::md_document() in the YAML metadata of your .Rmd files. Then knitting the file will generate a .md file designed to work well with hugo. The rest of hugodown just makes your life a little easier:

With hugodown, knitting an individual post and building the site are two separate processes. A good workflow when working with an existing Hugo site in RStudio is to open the site's .Rproj file, use hugo_start(), then add or edit your posts. Because the hugo server will only add .Rmd content to your site preview after knitting, you'll need to use the keyboard shortcut to knit first.

Citations

To use citations in a blog post, just provide a bibliography in the YAML metadata. If you want to use footnotes for citations (a style that generally works well in blogs), you'll need to find a footnote style CSL file (e.g. chicago-fullnote-bibliography.csl, and use the following YAML header.

bibliography: refs.bib
suppress-bibliography: true
csl: chicago-fullnote-bibliography.csl

Converting from blogdown



r-lib/hugodown documentation built on Nov. 24, 2022, 10:06 a.m.