blogdown中的new_site导致编辑器出错

时间:2017-09-25 10:22:47

标签: r blogdown

我一直在尝试使用来自blogdown: Creating Websites with R Markdown的快速示例,使用blogdown和hugo设置new_site;但是,在通过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

虽然新帖子会显示在内容/帖子文件夹中。

感谢您提出解决方法的建议。

1 个答案:

答案 0 :(得分:2)

通过更新到最新版本的RStudio的插件解决了这个问题。当您尝试通过“工具&gt; Addins&gt; New Post”创建“new_post”时,会自动从RStudio触发此操作。 RStudio将自动更新,安装和加载所需的软件包。

在这种情况下:

install.packages("miniUI")
install.packages("rstudioapi")