Before blogdown 0.20, I placed _output.yml under content/post so that all the posts share the output options.
However, since blogdown 0.20, my posts do not share the _output.yml because the default value of the blogdown.new_bundle option become TRUE, and each posts are nested in individual subdirectories under post.
I love the change, but I also want to keep sharing the _output.yml among posts.
Is there any way?
I did not even know this was a feature. That you could put _output.yaml in content/post to share options. It was a nice side effect of how rmarkdown is working. With bundle it will indeed not work, as with any project folder where you would store Rmd files in subfolders.
However, there is a way to precise this at the doc level. Have you tried setting
output_yaml: "../_output.yaml"
in the header of your posts ? It is not the same but I think it should work as it is a way to pass a specific _output.yaml (or other name) to rmarkdown::render
For supporting the old way you used with Hugo Page bundles, which the blogdown.new_bundle is about, I think it would require some special handling in blogdown. Like an option to set in .Rprofile to indicate where this file would be, or looking for a _output.yaml file in the parent folder if bundles are used but it would then put a rmarkdown logic inside blogdown itself.
Maybe setting this field in the header of all post is easy enough to do ?
I let your try and come back with feedback ! thanks !
Oh and I think you could also use _site.yml and the output field to pass this type of option.
The file is always at the root of the project so I think it would work no matter the bundles or not.
This is also a side effect of how rmarkdown is working for website when this files is taken into account to find options for a format. But it also set a site name and an output dir so it may have undesired side effects when used with blogdown - I should try that... Interaction between all the stack is always tricky !
Thanks. Unfortunately, neither output_yaml parameter of _site.yml work as far as I tried.
I'll try dig the problem.
If _site.yml works, that sounds the best solution.
And BTW _site.yml won't work with blogdown because it will also consider the Rmd root dir as the directory where _site.yml is look for. So no side effect as I thought earlier. Sorry for misleading you.
You should open an issue then as a feature request to have a way to pass option into html_page format when using blogdown. That way it it will be in the backlog and can be discussed!
For reference, supported solution in blogdown is to use _output.ymlAt the root directory of the project website. This file will be taken into account by each post Rmd.