Skip to content

Commit

Permalink
remove the method argument of build_site(), and the use_brew method o…
Browse files Browse the repository at this point in the history
…f install_hugo()
  • Loading branch information
yihui committed Mar 4, 2021
1 parent 3acf9c2 commit f324246
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 37 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGES IN blogdown VERSION 1.3

## MAJOR CHANGES

- The `method` argument of `build_site()` has been removed (it was defunct in **blogdown** v1.2). Please set the build method in the global option `options(blogdown.method = )` instead.

- The `use_brew` argument of `install_hugo()` has been removed.

# CHANGES IN blogdown VERSION 1.2

Expand Down
17 changes: 4 additions & 13 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,17 @@
#' Alternatively, this argument can take a file path of the zip archive or
#' tarball of the Hugo installer that has already been downloaded from Github,
#' in which case it will not be downloaded again.
#' @param use_brew Whether to use Homebrew (\url{https://brew.sh}) on macOS to
#' install Hugo. This argument has been deprecated. You are not recommended to
#' install Hugo via Homebrew, because you may accidentally update it to the
#' latest version, which might break your existing sites.
#' @param extended Whether to use extended version of Hugo that has SCSS/SASS
#' support. You only need the extended version if you want to edit SCSS/SASS.
#' @param force Whether to reinstall Hugo if the specified version has been
#' installed.
#' @param ... Ignored.
#' @note For macOS users, you are not recommended to install Hugo via Homebrew,
#' because you may accidentally update it to the latest version, which might
#' break your existing sites.
#' @seealso \code{\link{remove_hugo}()} to remove Hugo.
#' @export
install_hugo = function(
version = 'latest', use_brew = FALSE, extended = TRUE, force = FALSE, ...
) {

if (!missing(use_brew)) stop(
"The argument 'use_brew' has been deprecated in install_hugo(). If you want to ",
"install Hugo via Homebrew, please use the command line instead: brew install hugo"
)

install_hugo = function(version = 'latest', extended = TRUE, force = FALSE, ...) {
local_file = if (grepl('[.](zip|tar[.]gz)$', version) && file.exists(version))
normalizePath(version)

Expand Down
9 changes: 1 addition & 8 deletions R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
#' @param local Whether to build the website locally. This argument is passed to
#' \code{\link{hugo_build}()}, and \code{local = TRUE} is mainly for serving
#' the site locally via \code{\link{serve_site}()}.
#' @param method This argument has been deprecated. Please set the global option
#' \code{blogdown.method} instead. See \sQuote{Details}.
#' @param run_hugo Whether to run \code{hugo_build()} after R Markdown files are
#' compiled.
#' @param build_rmd Whether to (re)build R Markdown files. By default, they are
Expand All @@ -65,12 +63,7 @@
#' 'md5sum'} is equivalent to \code{build_rmd = blogdown::filter_md5sum}.
#' @param ... Other arguments to be passed to \code{\link{hugo_build}()}.
#' @export
build_site = function(local = FALSE, method, run_hugo = TRUE, build_rmd = FALSE, ...) {
if (!missing(method)) stop(
"The 'method' argument has been deprecated. Please set the method via ",
"options(blogdown.method = ). See ?blogdown::build_site for more info."
)

build_site = function(local = FALSE, run_hugo = TRUE, build_rmd = FALSE, ...) {
knitting = is_knitting()
if (!knitting) on.exit(run_script('R/build.R', as.character(local)), add = TRUE)
if (build_method() == 'custom') return()
Expand Down
5 changes: 1 addition & 4 deletions man/build_site.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions man/install_hugo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f324246

Please sign in to comment.