Making hugo-academic blogposts in RStudio

Is there a way to make properly formatted blog posts in RStudio?

I’m using blogdown to write a blog post in RMarkdown (extension .rmd). When I knit it to markdown by following these instructions I do get a markdown file.

However, while the metadata in the .rmd file is set off with this

> ---
> author: me
> title: title
> tags:
> -R
> ---

There is no metadata in the md file that is knitted.

However, when I try to build my hugo site, the process chokes because the document is not properly formatted as a blog post.

Or do I have to write a blog post manually outside of RStudio complying with the requirements of the Hugo-academic theme? If I do that, how do I include R code chunks?

are you getting an error message?

The code you have there looks like typical frontmatter, only the tag is missing a space between the dash and the R.

Yes, when I knit it to markdown, I have no problems, but when I build it with hugo, I get this. When I delete the Markdown file that I knit, the hugo build works fine.

Building sites … ERROR 2018/03/03 07:27:50 Error while rendering "home" in "": template: theme/index.html:1:3: executing "theme/index.html" at <partial "widget_page...>: error calling partial: template: theme/partials/widget_page.html:23:9: executing "theme/partials/widget_page.html" at <partial $widget $par...>: error calling partial: template: theme/partials/widgets/posts.html:61:51: executing "theme/partials/widgets/posts.html" at <len .Params.tags>: error calling len: len of untyped nil

can you please share the source code? And an example content file would be good.

I’m using RStudio to write the blog post. That knits an Rmarkdown file to someother file.
There must be a conflict between how RStudio produes a file and how the academic theme interprets that output. Because without a markdown file produced from RStudio, the site compiles fine.

The markdown file you have there should be more than enough to render the site.

Why do you need to ‘knit’ ? And what exactly do you mean by it?

also, the problem is in line 23 of your widget_page.html file.

I’m using RStudio and it “knits” Rmarkdown files to markdown files. There must be a conflict between how the academic theme interprets material produced by RStudio.