blog_dir = '/media/msfz751/2560x/repos/blogdown-sites/apreshill' file <- file.path(blog_dir, "content/post", "2017-12-18-r-ladies-presentation-ninja", "index.Rmd") file.exists(file)
# read markdown file x <- xfun::read_utf8(file) res <- blogdown:::split_yaml_body(x) # split in two res_yaml <- res$yaml # character vector res_yaml
# read from a character vector and convert to R objects library(yaml) res_li <- read_yaml(text = res_yaml) # read and convert to a list res_li
names(res_li)
res_li$links names(res_li$links)
cat(as.yaml(res_li))
write_yaml(as.yaml(res_li), file = "two-links.yaml")
write_yaml(res_li, file = "two-links.yaml")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.