Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom flags for the hugo command via hugo_build() #382

Merged
merged 3 commits into from May 10, 2019

Conversation

jozefhajnala
Copy link
Contributor

@jozefhajnala jozefhajnala commented May 10, 2019

Since Hugo v0.47 there is minification support for the final rendered output. This PR proposes an option to use --minify when building sites with blogdown.

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you okay with the alternative implementation I proposed? If you are, please remove the minify argument as well as the roxygen documentation. Thank you!

R/hugo.R Outdated
hugo_cmd(c(
if (local) c('-b', site_base_dir(), '-D', '-F'),
if (isTRUE(do_minify)) c('--minify'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just do this:

Suggested change
if (isTRUE(do_minify)) c('--minify'),
getOption('blogdown.hugo.args'),

since it is more general-purpose and allows you to set arbitrary hugo options, not limited to --minify.

This new option should be documented at https://bookdown.org/yihui/blogdown/more-global-options.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done in jozefhajnala@db3c0da

@yihui
Copy link
Member

yihui commented May 10, 2019

Please also remember to add an item to NEWS.md for this new feature and your name to DESCRIPTION.

@jozefhajnala
Copy link
Contributor Author

Please also remember to add an item to NEWS.md for this new feature and your name to DESCRIPTION.

Done (in a separate commit), please feel free to comment on conventions/wording, happy to align.

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thanks!

@yihui yihui modified the milestones: v0.12, v0.13 May 10, 2019
@yihui yihui changed the title Add minification support to hugo_build() Support custom flags for the hugo command via hugo_build() May 10, 2019
@yihui yihui merged commit 71881a7 into rstudio:master May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants