unmarshal failed: Near line 0 (last key parsed ''): Bare keys cannot contain ':' in Rmarkdown blogdown 与 Hugo

unmarshal failed: Near line 0 (last key parsed ''): bare keys cannot contain ':' in Rmarkdown blogdown with Hugo

在 Rmarkdown 中 运行 build_site() 时出现此构建错误,我最初忽略了该错误,因为它似乎没有问题。但是现在在尝试从 netlify 部署之后,错误是不允许构建和部署站点。

我收到错误

unmarshal failed: Near line 0 (last key parsed ''): bare keys cannot contain ':'

它说错误在我的 config.toml:1:1 文件中,但文件显示为 config.toml,但我没有手动更改此文件,除非 blogdown 覆盖了它?我在很多博客中都没有出现过这个错误。

我的config.toml文件在下面

name: "blog"
title: "blog name"
description: |
  blog name
output_dir: "_site"
navbar:
  right:
    - text: "Home"
      href: index.html
output: distill::distill_article

如有任何帮助,我们将不胜感激,如果需要,我可以展示更多细节。谢谢,

看来,由于这是一个 Distill 博客,所以没有使用 .toml/.yaml 文件,我使用的函数是针对 blogdown 站点的,因为这是一个 Distill 博客,我需要使用 functino render_site() 来自 rmarkdown 包,这会将 .Rmd 文件渲染到 HTML 并将它们推送到 _sites 目录以进行发布。

在最新版本的Hugo中,默认会自动搜索根目录下的数据config.toml文件,您使用的主题必须是config.yaml的配置文件。把原来的config.toml删掉就行了。注意:在.toml 中,':' self 字符是不允许的。应该是'='。