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

1.1 Installation

我们假设您已经安装:

如果您没有使用 RStudio IDE,请安装 Pandoc (http://pandoc.org)。参考站点上提供了说明 (https://pandoc.org/installing.html) 。

blogdown 包在 CRAN 上可用,您可以使用以下命令安装它:

install.packages('blogdown') 

1.1.1 Installation troubleshooting

你有旧版本的 blogdown 吗?将您的版本与我们的版本进行比较,并在必要时进行升级。

packageVersion("blogdown")
## [1] '1.19'

要更新 blogdown,请运行 install.packages('blogdown')

您是否有旧版本的 blogdown 依赖项(例如 rmarkdown)?如果您遇到问题,您可以首先尝试更新所有 R 软件包:

update.packages(ask = FALSE, checkBuilt = TRUE)

如果您仍然遇到 blogdown 问题,您可以尝试从 GitHub 安装开发版本:

if (!requireNamespace('remotes')) install.packages('remotes')
remotes::install_github('rstudio/blogdown')

如果您使用 RStudio,它会提醒您在安装或更新当前正在使用的任何软件包之前重新启动 R。如果您不使用 RStudio,您可能需要自行重新启动 R。

References

R Core Team. 2022. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.