Releases: rstudio/blogdown
blogdown 1.10
-
For Jekyll sites, a new global option can be used to determine whether to run
jekyll
directly or use thebundler
gem to runjekyll
(i.e.,bundle exec jekyll
). If you prefer the latter way, you may setoptions(blogdown.jekyll.bundler = TRUE)
before runningblogdown::serve_site()
(thanks, @pat-s, #695). -
Adapted to some breaking changes in the wowchemy academic theme again (thanks, @bjsmith, #704). As mentioned in blogdown v1.4, we recommend blogdown users to consider using the hugo-apero theme when creating new sites. This theme is maintained by blogdown authors and much more stable.
-
Updated documentation to mention that the
tweet
shortcode (or the R wrapper functionblogdown::shortcode('tweet')
) will require the Twitter username for Hugo >= v0.89.0. Previously only the tweet ID is required, e.g.,{{< tweet 852205086956818432 >}}
, but now it also requires the user, e.g.,{{< tweet user="jtleek", id="852205086956818432" >}}
(thanks, @lcolladotor, #701).
blogdown 1.9
NEW FEATURES
- The RStudio addin "Insert Image" also works when the current document in RStudio does not belong to any site projects. Previously, it would throw an error if it is not used inside a site project. Now it works in any document in RStudio (thanks, @yufree, rstudio/rmarkdown#2280).
BUG FIXES
blogdown 1.8
NEW FEATURES
-
The bookdown config file
_bookdown.yml
under the site root directory is recognized now. For example, you can customize the figure label in_bookdown.yml
(thanks, @luofeicq, yihui/yihui.org#167). -
The internal function
scan_yaml()
uses cache in the current R session now. Other functions (e.g.,find_yaml()
,count_yaml()
, and the "New Post" addin in RStudio) based on this function should be much faster when there are a lot of files to scan for more than once.
BUG FIXES
blogdown 1.7
MINOR CHANGES
-
The
version
argument offind_hugo()
allows for the prefixv
in the version number now, e.g.,find_hugo('v0.89.2')
is equivalent tofind_hugo('0.89.2')
. This is also true to other functions that usefind_hugo()
, such asremove_hugo()
. -
Clarified
write_toml()
's error message that Hugo >= 0.37 is required to run this function (thanks, @pssguy, #665).
BUG FIXES
-
install_hugo()
did not work for Hugov0.20.3
. -
new_post()
failed to correctly detect the path of the new post with Hugo >= 0.89.3 (thanks, @rcarboni, #667). -
Deal with the new security policy in Hugo 0.91.0 by renaming the internal environment variable
BLOGDOWN_POST_RELREF
(in the shortcodelayouts/shortcodes/blogdown/postref.html
) toHUGO_BLOGDOWN_POST_RELREF
(thanks, @Nitheshnirmal #672, @gergiu #673).
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).
blogdown 1.5
NEW FEATURES
-
Added a new function
check_vercel()
to check the Vercel configvercel.json
, and a new functionconfig_vercel()
to createvercel.json
that contains the Hugo version (thanks, @chuxinyuan, #648). Vercel (https://vercel.com) is service similar to Netlify. -
Added an argument
time
tonew_post()
to optionally include the local time in thedate
field of the new post withnew_post(time = TRUE)
. The value of this argument can also be set via the global option in.Rprofile
, e.g.,options(blogdown.time = TRUE)
(it isFALSE
by default). See the help page?blogdown::new_post
for more information (thanks, @earfanfan, #625).
BUG FIXES
-
The duplicated
config/
directory is deleted from the theme now (thanks, @shirdekel, #644). -
The
categories
andtags
fields in archetypes were not respected when creating new posts (thanks, Conor Neilson, https://stackoverflow.com/q/68879106/559676).
blogdown 1.4
NEW FEATURES
check_config()
now checks forbaseURL
that only provides a domain name but lacks thehttps
(orhttp
) protocol, e.g.,baseURL: example.com/
is typically not a valid URL, but should behttps://example.com/
instead (thanks, @apreshill, #616).
BUG FIXES
-
Fixed a new issue with
blogdown::new_site(theme = "wowchemy/starter-hugo-academic")
(#638). To avoid similar issues with the academic theme in the future, we recommend that you consider using thehugo-apero/hugo-apero
theme instead. -
install_hugo()
can install the correct version of Hugo on a machine with an ARM processor now (thanks, @r-saikat, #636). -
clean_duplicates()
now correctly deletes duplicated.html
file instead of.md
whenblogdown.method
option is set tomarkdown
(thanks, @apreshill, #628). -
clean_duplicates()
also correctly deletes unused directories like*_files/header-attrs
associated with.html
output files (thanks, @apreshill, #632).
blogdown 1.3
NEW FEATURES
-
check_config()
will suggest ignoring therenv
folder and therenv.lock
file in the Hugo config if renv is used in the project (thanks, @solarchemist, #597). -
check_content()
will also discover problematic YAML metadata of posts that is not a list (thanks, msmielak, https://stackoverflow.com/q/66857582/559676). -
New project menu in RStudio IDE now allows to select for keeping
config.toml
(thanks, @ogansser, #606).
MAJOR CHANGES
-
The
method
argument ofbuild_site()
has been removed (it was defunct in blogdown v1.2). Please set the build method in the global optionoptions(blogdown.method = )
instead. -
The
use_brew
argument ofinstall_hugo()
has been removed.
BUG FIXES
-
check_content()
will ignorerenv
folders when looking for Rmd/md files to be checked (thanks, @solarchemist, #597). -
The RStudio addin "Update Metadata" does not work when the global option
blogdown.rename_file
is not set (thanks, @brshallo, #605). -
The RStudio addin "New Post" does not work when the YAML metadata of a post only contains a string. Normally the metadata should be a list (thanks, msmielak, https://stackoverflow.com/q/66857582/559676).
-
When
.Rmd
is not ignored in theignoreFiles
field in the site config file (this can be detected byblogdown::check_site()
and you should fix it),.Rmd
files may be copied to thepublic/
directory when building the site viablogdown::build_site()
, which can cause problems whenblogdown::serve_site()
is running, i.e.,.Rmd
files will be rendered to thermarkdown::html_document()
format byrmarkdown::render()
. As a result, the corresponding web pages will not be rendered by Hugo but only Pandoc, and they will lose the site style or shortcodes (thanks, @ogansser, #610 #608). Nowblogdown::check_site()
should detect this problem and recommend fixes.
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).
blogdown 1.1
NEW FEATURES
-
Added new arguments
args
,baseURL
, andrelativeURLs
to thehugo_build()
function to allow users to pass more command-line arguments to Hugo and adjust the configurationsbaseURL
andrelativeURLs
temporarily when building a site. -
Added the
...
argument tobuild_site()
, to pass more arguments to thehugo_build()
function, e.g.,blogdown::build_site(relativeURLs = TRUE)
. -
Added a global option
blogdown.server.verbose
to print the web server messages in real time when the server is running. Once enabled (viaoptions(blogdown.server.verbose = TRUE)
), you will see messages in the R console like "Change detected, rebuilding site" whenever you make changes to any files (thanks, @apreshill @cderv, #555). -
Added a new global option
blogdown.protect.math
(defaults toTRUE
) to control whether to protect LaTeX math expressions in a pair of backticks when the post output format is Markdown instead of HTML. The reason to protect math expressions is to avoid the Markdown renderer's treatment of the math content as normal Markdown content, which may mangle the math expressions. If the math expression is protected, it needs to be unprotected later. See https://yihui.org/en/2018/07/latex-math-markdown/ for more information. Note that this option is only relevant to those who use the source format.Rmarkdown
or the build methodoptions(blogdown.method = 'markdown')
(thanks, @bensoltoff #466, @mrkaye97 #567).
BUG FIXES
-
bundle_site()
also moves the.html
output files and the*_files/
/*_cache/
directories associated with.Rmd
source posts to page bundles. Previously, only.Rmd
files are moved (thanks, @llrs, #568). -
Fixed a bug of
install_theme()
when the theme archive contains theme files directly instead of a theme folder (thanks, Stefan Musch, https://stackoverflow.com/q/65702805/559676). -
Fixed a bug that causes HTML widgets to fail to render in the Markdown output files with htmltools >= 0.5.1.
-
Fixed a bug on Windows that causes
check_gitignore()
to error when it shouldn't (#571).
MAJOR CHANGES
- When the site is rendered via a call to
rsconnect::deploySite()
(e.g., when you callrmarkdown::publish_site(render = TRUE)
),blogdown::build_site()
will use the argumentrelativeURLs = TRUE
, to make Hugo generate relative URLs that work with any base URL (note that this depends on how well a specific Hugo theme supports relative URLs).
MINOR CHANGES
-
check_netlify()
andcheck_config()
do not open files anymore in the IDE if no TODO items were found in them (#569). -
The internal functions
md5sum_filter()
andtimestamp_filter()
have been removed. They were renamed tofilter_md5sum()
andfilter_timestamp()
, respectively, and exported in blogdown 1.0. Please use these exported functions instead if you relied on the internal functions previously.