A note from the authors: Some of the information and instructions in this book are now out of date because of changes to Hugo and the blogdown package. If you have suggestions for improving this book, please file an issue in our GitHub repository. Thanks for your patience while we work to update the book, and please stay tuned for the revised version!
In the meantime, you can find an introduction to the changes and new features in the v1.0 release blog post and this "Up & running with blogdown in 2021" blog post.
— Yihui, Amber, & Alison
Software information and conventions
The R session information when compiling this book is shown below:
sessionInfo()
## R version 4.2.2 (2022-10-31)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur ... 10.16
##
## Matrix products: default
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets
## [6] methods base
##
## loaded via a namespace (and not attached):
## [1] bookdown_0.33 blogdown_1.16.1 rmarkdown_2.20
## [4] htmltools_0.5.4 knitr_1.42
We do not add prompts (>
and +
) to R source code in this book, and we comment out the text output with two hashes ##
by default, as you can see from the R session information above. This is for your convenience when you want to copy and run the code (the text output will be ignored since it is commented out). Package names are in bold text (e.g., rmarkdown), and inline code and filenames are formatted in a typewriter font (e.g., knitr::knit('foo.Rmd')
). Function names are followed by parentheses (e.g., blogdown::serve_site()
). The double-colon operator ::
means accessing an object from a package.
A trailing slash often indicates a directory name, e.g., content/
means a directory named content
instead of a file named content
. A leading slash in a path indicates the root directory of the website, e.g., /static/css/style.css
means the file static/css/style.css
under the root directory of your website project instead of your operating system. Please note that some directory names are configurable, such as public/
, but we will use their default values throughout the book. For example, your website will be rendered to the public/
directory by default, and when you see public/
in this book, you should think of it as the actual publishing directory you set if you have changed the default value. Rmd
stands for R Markdown in this book, and it is the filename extension of R Markdown files.
A “post” often does not literally mean a blog post, but refers to any source documents (Markdown or R Markdown) in the website project, including blog posts and normal pages. Typically blog posts are stored under the content/post/
directory, and pages are under other directories (including the root content/
directory and its subdirectories), but Hugo does not require this structure.
The URL http://www.example.com
is used only for illustration purposes. We do not mean you should actually visit this website. In most cases, you should replace www.example.com
with your actual domain name.
An asterisk *
in a character string often means an arbitrary string. For example, *.example.com
denotes an arbitrary subdomain of example.com
. It could be foo.example.com
or 123.example.com
. Actually, foo
and bar
also indicate arbitrary characters or objects.