Closed andrewheiss closed 7 years ago
I may be having the same issue - although it is when I want to put a horizontal line in the body of the post. When I do, the following chunk loses its controls
before
after
I should have stated I'm on Windows: Version 1.1.345 so this might already have been addressed
@andrewheiss A YAML file should not contain three dashes. The notion of three dashes only exists in Markdown files. They mark the beginning and end of YAML metadata but they are not part of the metadata.
@pssguy Your issue is different (please file new issues unless you are very sure you have the same issue). Do you have an empty line before and after three dashes?
Hugo supports dashes in standalone YAML files, though (see https://github.com/kjhealy/kieranhealy.hugo/blob/master/config.yaml, for instance)
Hmm, interesting. The R package yaml does not support them, and I cannot support them in blogdown since blogdown uses yaml to parse YAML files. Anyway, I guess it does not hurt if you remove them.
The fact that yaml can't handle them makes sense. I was struggling to figure out why Hugo could handle them while blogdown choked. Thanks!
I could write a helper function to get rid of the three dashes before parsing the YAML data, but I want to wait until another person reports this issue.
Or perhaps a warning telling people to remove the dashes?
Okay, I'll just add a wrapper function to yaml::yaml.load_file()
. Thanks for the suggestion!
Three dashes in config.yaml will be ignored from now on.
I'm not a consumer of this library and I know this has been fixed, but YAML absolutely supports three dashes as a document delimiter, and even a single document created by jackson will start with ---
http://yaml.org/spec/current.html#id2502724
When using a YAML-based config file, blogdown breaks if config.yaml starts/ends with
---
delimiters, which are typically allowed in Hugo config files.(Using R 3.4.1 on macOS with blogdown 0.1.2, 2017-08-29, Github (rstudio/blogdown@3df12f3))
Here's a minimal example:
Using the following
config.yaml
…… creates this error when running
create_site()
:However, removing the
---
s …… results in no error:
Running
hugo
from the terminal works just fine with and without the---
s inconfig.yaml
, but it naturally doesn't parse any Rmd files. Is there anything stopping blogdown from parsing---
YAML files correctly?Here's the full session information: