blogdown 1.6
NEW FEATURES
-
The config file
config/_default/config.yaml
(or.toml
) is supported now; blogdown no longer requires thatconfig.yaml
(or.toml
) is under the root directory of the website project. Note that ifconfig.yaml
is present under both the root directory and theconfig/_default/
directory, blogdown will only recognize the former, and you may want to delete the former if you actually intend to use the latter (thanks, @Athanasiamo @maelle #611, @diegouriarte #598). -
install_hugo()
can automatically correct the version numberX.Y
toX.Y.0
whenX.Y
does not exist butX.Y.0
does. For example,install_hugo('0.87')
will actually install the version0.87.0
. -
Added a global option
blogdown.server.first
, which can be specified as a function to run before serving the site. For example, you can sync a JS file to thestatic/
directory withoptions(blogdown.server.first = function() { file.copy('../foo/bar.js', './static/js/', overwrite = TRUE) })
each time before you serve the site. -
Added arguments
arch
andos
toinstall_hugo()
so that users can choose the architecture and operating system names manually. For example,blogdown::install_hugo(extended = FALSE, arch = '64bit', os = 'FreeBSD')
would installhugo_*_FreeBSD-64bit.tar.gz
(*
denotes a version number) from https://github.com/gohugoio/hugo/releases. -
Added a new function
hugo_installers()
to print out the information about available Hugo installers of a certain version. This can be helpful wheninstall_hugo()
fails, e.g., the installer for a certainos
orarch
is not available.
MAJOR CHANGES
- When creating new posts (either with
new_post()
or the RStudio addin "New Post"), the default post filename will be generated from the post title but it will exclude all non-alphanumeric characters. Previously the exclusion of these characters failed under certain locales (e.g., UTF-8 or a locale that has native support for multibyte characters). Now the default filename will no longer contain non-alphanumeric characters except dashes (thanks, yingjie, https://d.cosx.org/d/422702).
MINOR CHANGES
- The intermediate files
.knit.md$
and.utf8.md$
no longer need to be ignored inignoreFiles
in the Hugo config file now. There is no harm to ignore them anyway. If you have ignored them, you do not need to update your config (#609).
BUG FIXES
-
The global option
blogdown.subdir_fun
can be a function that takes the post title as the input and returns a path of subdirectory under which the new post is to be created via the "New Post" addin in RStudio. The "New Post" addin failed to add the subdirectory defined by this function to the choices of the "Subdirectory" select input if the subdirectory does not exist in the choices, therefore it could not really be used. Now the subdirectory is corrected added, and can be used (thanks, @datawookie, #656). -
install_hugo()
stopped working with Hugo v0.89.0 (thanks, @martinolmos, #664). -
On Windows,
new_post()
may fail to open the new post if the filename contains multibyte characters (thanks, yingjie, https://d.cosx.org/d/422702).