(This is an edited repost from #289 which hasn't received a response in 6 months. If it's on people's radar, please feel free to close this issue)
A tiny bit of background: I am a uni teacher so hosting both slides and lecture handouts/worksheets in an integrated easy-to-use, easy-to-maintain way is important when creating a course website.
I think that enabling users to define custom formats while keeping blogdown::html_page as the default should be fairly simple.
Here is my suggestion (implemented in this commit):
config.yaml should have an optional renders: parameter, such as:
blogdown::build_site() then reads renders from config.yaml and passes it down to blogdown:::build_one() which looks for the type: parameter in a .Rmd file's YAML front matter. If there isn't one, the file gets rendered by the default method. In this scenario, files with type: slides in YAML get rendered with my_pkg::my_format.
Using the type: param is handy because it allows custom HUGO templates for files of a given type.
If there is no renders: in config.yaml, everything gets rendered by blogdown::html_page so it would not be a breaking change.
The implementation linked above doesn't deal with TOML but I don't imagine it would take a lot of work to expand.
I've been working on a blogdown/HUGO theme for course websites I would like to release and this feature is crucial for it.
Hi all,
(This is an edited repost from #289 which hasn't received a response in 6 months. If it's on people's radar, please feel free to close this issue)
A tiny bit of background: I am a uni teacher so hosting both slides and lecture handouts/worksheets in an integrated easy-to-use, easy-to-maintain way is important when creating a course website. I think that enabling users to define custom formats while keeping
blogdown::html_page
as the default should be fairly simple.Here is my suggestion (implemented in this commit):
config.yaml
should have an optional renders: parameter, such as:blogdown::build_site()
then reads renders fromconfig.yaml
and passes it down toblogdown:::build_one()
which looks for the type: parameter in a .Rmd file's YAML front matter. If there isn't one, the file gets rendered by the default method. In this scenario, files withtype: slides
in YAML get rendered withmy_pkg::my_format
. Using thetype: param
is handy because it allows custom HUGO templates for files of a given type.If there is no
renders:
inconfig.yaml
, everything gets rendered byblogdown::html_page
so it would not be a breaking change.The implementation linked above doesn't deal with TOML but I don't imagine it would take a lot of work to expand. I've been working on a blogdown/HUGO theme for course websites I would like to release and this feature is crucial for it.
Many thanks!