【问题标题】:How to fix an error with saving file "index.Rmd" in Blogdown?如何修复在 Blogdown 中保存文件“index.Rmd”时出现的错误?
【发布时间】:2021-12-31 14:47:14
【问题描述】:

我想帮助解决一个问题,但收到了我自己的问题。 哪里出了问题?

我试图从那里重复一些基础知识:https://bookdown.org/yihui/blogdown/a-quick-example.html

  • 所有指示都得到遵守和履行;

  • hugo已下载并安装;

  • 网站由blogdown::serve_site()发起。

有效!但是……

Launching the server via the command:
  C:/Users/User/AppData/Roaming/Hugo/0.89.4/hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-lithium -D -F --navigateToChanged
Serving the directory . at http://localhost:4321
Launched the hugo server in the background (process ID: 1780). To stop it, call blogdown::stop_server() or restart the R session.

...看,消息在哪里??? (如你所见there):

 Rendering content/post/2020-12-01-r-rmarkdown/index.Rmd... Done.

好的,我尝试向index.Rmd添加内容:

```{r}
summary(Orange)
```

而且,保存后,我们可以看到这条消息:

又是这些地狱般的替换符号和(Sys.setenv("LANGUAGE"="EN") 没有帮助,但这不是关于它们的故事)。

如何解决blogdown 中的index.Rmd 的这个问题?也许有人遇到过?

非常感谢您的帮助。


还有一点补充。

我删除并重新创建了“我的网站”。

此字符串已显示...

Rendering content/post/2020-12-01-r-rmarkdown/index.Rmd... Done.

...但是错误是一样的...


【问题讨论】:

    标签: r r-markdown blogdown


    【解决方案1】:

    这个答案是给未来的受难者和没有思想的人(就像我一样):

    伙计们,我们不应该触摸我们网站文件夹主目录中的“index.Rmd”!

    我说的对吗?


    给Yihui Xie:的一些建议

    为什么“主索引.Rmd”不能有别的名字,f.e.:

    mainIndex;
    primaryIndex;
    baseIndex;
    etc... 
    

    ...如果您在此文件中添加一些信息,那就太好了,f.e.

    <!-- If you want to add some new info to your site - come to "content - post - bla-bla - index.Rmd" --> 
    <!-- Please don't try to edit the current file --> 
    ---
    site: blogdown:::blogdown_site
    ---
    

    还是有人可以在“index.Rmd”之后添加一些内容并保存?

    【讨论】:

    • 我已在此文件中添加了评论:github.com/rstudio/blogdown/commit/… 感谢您的建议!
    • @YihuiXie 非常感谢!我们会在新版 blogdown 包中看到这个更新吗?
    • 不,现有的index.Rmd 不会被更新(它是只读的,这就是您无法保存编辑的原因)。此更改仅适用于新网站。
    猜你喜欢
    • 1970-01-01
    • 2021-03-05
    • 2019-12-08
    • 2021-01-12
    • 2020-11-01
    • 1970-01-01
    • 2013-07-04
    • 2011-12-30
    • 2019-07-11
    相关资源
    最近更新 更多