1

我一直在尝试使用 blogdown 中的快速示例使用 blogdown 和 hugo 设置new_site:使用 R Markdown 创建网站;但是,在通过 RStudio 创建的新空项目中调用 new_site() 命令后,出现以下错误。我不太确定错误调用的依据是什么,因此非常感谢任何解决此问题的帮助。

> new_site()
Congratulations! Your new Hugo site is created in C:\Users\XYZ\Downloads\Test2\Site.

Just a few more steps and you're ready to go:

1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".

Visit https://gohugo.io/ for quickstart guide and full documentation.
trying URL 'https://github.com/yihui/hugo-lithium-theme/archive/master.zip'
Content type 'application/zip' length 119078 bytes (116 KB)
downloaded 116 KB

Error in editor(file = file, title = title) : 
  argument "name" is missing, with no default

快速示例页面指出新站点应该出现在 RStudio 查看器中。这不会发生(假设由于错误)。但是,在调用服务站点后,该页面确实出现在查看器中。

> serve_site()
Rendering content/post/2015-07-23-r-rmarkdown.Rmd
Started building sites ...
Built site for language en:
0 draft content
0 future content
0 expired content
4 regular pages created
16 other pages created
0 non-page files copied
0 paginator pages created
3 tags created
1 categories created
total in 34 ms
Serving the directory C:\Users\XYZ\Downloads\Test2\Site at http://BLABLA

通过 new_post() 创建新帖子时也会触发该错误:

> new_post("MyTest")
C:\Users\XYZ\Downloads\Test2\Site\content\post\2017-09-25-mytest.md created
Error in editor(file = file, title = title) : 
  argument "name" is missing, with no default

虽然新帖子出现在内容/帖子文件夹中。

感谢您对如何解决它的任何建议。

4

1 回答 1

2

通过更新到最新版本的 RStudio 插件解决了这个问题。当您尝试通过“工具 > 插件 > 新帖子”创建“new_post”时,这会从 RStudio 自动触发。RStudio 将自动更新、安装和加载所需的包。

在这种情况下:

install.packages("miniUI")
install.packages("rstudioapi")
于 2017-09-25T10:41:08.073 回答