hrbrmstr/markdowntemplates

Hugo: YAML not rendered in ouput md file

Opened this issue · 3 comments

I am sure there is a reason why you left out the preserve_yaml argument in the md_document function in hugo.R, but am wondering if there might be a way to set additional values in the front matter of the Rmd file that are preserved for use in Hugo.

Nope :-) I was just experimenting. I'll work on adding this ASAP.

You know, what I think happens when you set preserve_yaml=TRUE is that the front matter gets duplicated:

---
title: "www"
slug: "www"
author: "www"
date: "YYYY-MM-DD"
output: markdowntemplates::hugo
---

---
author: www
date: YYYY-MM-DD
slug: www
status: draft
title: www
categories:
  - r
---
GitHub Documents
----------------

Btw, wanted to thank you for the cool package. Hugo in particular is very cool.

To chime in on a similar enhancement request...I'd love to add custom tags or categories or parameters to the header. For example, I would like to add something like:

---
title: "Blog1"
slug: "blog1"
author: "me"
date: "2016-06-13"
category:
  - foo
  - bar
tags: R
params:
  - image: blog1/chunk1.png
output: markdowntemplates::hugo
---

to get:

---
author: me
date: 2016-06-15
slug: blog1
status: draft
title: Blog1
categories:
  - foo
  - bar
tags: R
image: blog1/chunk1.png
---

Maybe this capability exists, and I've just been doing it wrong, but if not, I bet it would be really useful.