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

4.7k views Asked by At

Getting this build error when running build_site() in Rmarkdown, I originally ignored the error because it seemed to be fine otherwise. But now after trying to deploy from netlify the error is not allowing for the site to be built and deployed.

I get the error

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

It says the error is in my config.toml:1:1 file, but the file shows as config.toml, but I didn't manually alter this file, unless blogdown over wrote it? I haven't had this error in many blogs.

my config.toml file is below

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

any help would be appreciated, I can show more detail if needed. thank you,

2

There are 2 answers

1
MonsieuRuss On BEST ANSWER

In the latest version of Hugo, it automatically searches the data in the root directory by default config.toml File, the theme you use must be config.yaml Configuration file for. Just put the original config.toml Just delete it. Note: in. Toml, the ':' self character is not allowed. It should be '='.

0
Daniel_j_iii On

It appears that since this is a distill blog, the .toml/.yaml files are not used, the functions I was using are for blogdown sites, since this is a DISTILL blog, I need to use the functino render_site() from the rmarkdown package, this renders the .Rmd files into HTML and pushes them to the _sites directory for publishing.