Skip to content

Commit

Permalink
Support custom flags for the hugo command via hugo_build() (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefhajnala authored and yihui committed May 10, 2019
1 parent 91e6af2 commit 71881a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Authors@R: c(
person("Leonardo", "Collado-Torres", role = "ctb"),
person("Xianying", "Tan", role = "ctb"),
person("Raniere", "Silva", role = "ctb"),
person("Jozef", "Hajnala", role = "ctb"),
person(family = "RStudio Inc", role = "cph"),
person()
)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CHANGES IN blogdown VERSION 0.13

## NEW FEATURES

- Added a global option `blogdown.hugo.args`, which should be a character vector with additional flags to be passed to the `hugo` system command via `hugo_build()`. For example, `options(blogdown.hugo.args = '--minify')` will use [minification](https://gohugo.io/news/0.47-relnotes/) on the final rendered output. More available flags in the [hugo documentation](https://gohugo.io/commands/hugo#options) (thanks, @jozefhajnala, #382).

# CHANGES IN blogdown VERSION 0.12

Expand Down
1 change: 1 addition & 0 deletions R/hugo.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ hugo_build = function(local = FALSE) {
if (local) tweak_hugo_env()
hugo_cmd(c(
if (local) c('-b', site_base_dir(), '-D', '-F'),
getOption('blogdown.hugo.args'),
'-d', shQuote(publish_dir(config)), theme_flag(config)
))
}
Expand Down

0 comments on commit 71881a7

Please sign in to comment.