I am trying to render a bunch of .html pages from .Rmd by using rmarkdown::render() on a template .Rmd and pass it some variable through a loop.
for (i in some_vector){
rmarkdown::render(my_template.Rmd,
output_format = "html_document",
output_file = ... ,
output_dir = ... )
}
The template is set up to expect the variable and renders fine. However, other .Rmd pages in other parts of the site no longer render properly if I generate my .html files then run blogdown::serve_site()
The .html files rendered by blogdown::serve_site() seem to have incorrect headers and missing html parts when rendered automatically by blogdown. The generated html page still retains the yaml header components at the top of the file.
Eg:
---
title =
date =
layout =
author =
---
If I don't batch generate my files, and simply run serve_site() on the existing site files then I get no issue. My suspicion is that running rmarkdown::render() changes some session parameter, but I have no idea. My aim is to create the necessary pages myself and then have blogdown render the rest upon serve_site().
Does anyone have any idea what the issue is?