blogdown 1.2
NEW FEATURES
-
Added the argument
force
back toinstall_hugo()
. If the specified version of Hugo has been installed,install_hugo()
will not reinstall it unlessforce = TRUE
(thanks, @cderv, #575). -
The new option
options(blogdown.knit.serve_site = FALSE)
can be used to prevent blogdown from starting the web server automatically when the Knit button is clicked in RStudio and the site has not been served yet (thanks, @Athanasiamo, #572). By default, the web server will be started (if not already started) so the page being knitted can be previewed. -
Added a new global option
blogdown.site_root
, which can be used to specify the root directory of the website. This can be useful when the website source directory is not the root directory of a project but a subdirectory (thanks, @wjakethompson, #581). -
Added a new global option
blogdown.markdown.format
to allow users to customize Pandoc's Markdown output format. When using the file extension.Rmarkdown
oroptions(blogdown.method = 'markdown')
, an R Markdown file is first compiled to Markdown. This Markdown file needs to go through another conversion when it contains Markdown features that are only available to Pandoc but not other Markdown renderers such as Hugo/Goldmark, such as citations or fenced Divs. The new global option controls the Pandoc output format. By default, its value isc('gfm', '+footnotes', '+tex_math_dollars')
for Pandoc 2.10.1 and later when the Markdown document contains bibliography or fenced Divs, otherwise it isNULL
. With earlier versions of Pandoc, it will bec('gfm')
only. If you want the conversion to be always performed, you may set this global option to a value that is notNULL
, e.g.,options(blogdown.markdown.format = c('gfm', '+footnotes', '+tex_math_dollars', '+smart'))
.
MAJOR CHANGES
-
The
method
argument ofbuild_site()
is now defunct (it was deprecated in blogdown v1.0), and will be removed in a future version. Please set the build method in the global optionoptions(blogdown.method = )
instead. -
The
use_brew
argument ofinstall_hugo()
is defunct now, and will be removed in a future version. -
The
update_hugo()
function is defunct. Please useinstall_hugo()
instead. -
The scripts
R/build.R
andR/build2.R
are no longer executed when a document is compiled via the Knit button in RStudio. They will be executed only when building the whole site viabuild_site()
(e.g.,Ctrl/Cmd + Shift + B
in RStudio).
BUG FIXES
-
check_config()
will now correctly check for both missing and unneeded values in theignoreFiles
field in the config file. -
When serving the site with
blogdown::serve_site()
with'blogdown.knit.on_save'
option beingTRUE
, Rmd files inrenv/
orpackrat/
folder are now correctly ignored and not rebuilt (#593). -
For
.Rmarkdown
posts, the Markdown extensiontex_math_dollars
should not be used when post-processing the.markdown
output file with Pandoc < v2.10.1 (thanks, @lz100, #578). -
The
new_post()
function does not work with bundle archetypes (thanks, @maelle, #577). -
install_theme()
will now remove the.github/
folder if one exists in the theme repo as it is only useful to the theme developer (#584). -
Plots generated from R code chunks in posts cannot be previewed on RStudio Server (thanks, @cderv @datawookie #587).
-
The error "RStudio is not running" should be suppressed when building the site in a non-interactive R session (thanks, @kcarnold, #596).
-
The theme
gcushen/hugo-academic
is now correctly automatically redirected towowchemy/starter-academic
with correct default git branch when installing withnew_site()
orinstall_theme()
. -
Also try to move
config/_default/config.yaml
to the root dir when installing a theme. Previously, onlyconfig.toml
was moved (thanks, @andreashandel, #546). -
When installing a theme, delete
figure
shortcodes that useshttp
resources because the figure paths could be mangled on Windows (thanks, @andreashandel, #546).
MINOR CHANGES
-
When clicking the Knit button in RStudio to knit a post, the normal knitting process is shown (such as the progress bar) instead of being suppressed (thanks, @Athanasiamo, #572).
-
The command
blogdown:::preview_site()
is no longer called or displayed in the R console when users click the Knit button after the server has been started (thanks, @apreshill, #543). -
The config option
ignoreErrors
will be set to"error-remote-getjson"
when runningblogdown::serve_site()
. This is to prevent Hugo errors in fetching remote resources such as Tweets (thanks, @earfanfan https://d.cosx.org/d/422065 and dhonda https://stackoverflow.com/q/64601786/559676).