-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
templates/content-home.html is ignored if source is .Rmd #787
Comments
I've rebased that branch with the failing test onto the current master: https://github.com/goldingn/pkgdown/tree/rmd_home_template I might be able to take a swing at getting home templates to work for Rmds this week. I'd appreciate any pointers though. Especially why md and Rmd are treated so differently, rather than converting Rmd to md first. |
I'm not sure what you're trying to do. Do you want to be able to render a |
The general issue is that a custom content-home template is ignored if the source file is an Rmd (but not if it is an md), which isn't documented and seems like a bug. My main aim is to get rid of the sidebar and the column it goes in, and take the index content out of the the row and column it's in, since I want a full width banner. I could do this if I could use a custom template of:
Those rows and columns are hard-coded into the content-home template: How would I turn them off with css? |
When building the home page, the template content-home.html is only respected if the source is a .md or DESCRIPTION file. If it's index.Rmd or README.Rmd, the template content-article.html is used instead.
That caught me out whilst building a custom site with my own templates, and means the sidebar can't be removed from the home page without also removing it from all the articles.
The switch happens here:
https://github.com/r-lib/pkgdown/blob/master/R/build-home-index.R#L14-L26
and the call stack for .Rmd sources goes:
render_index()
>build_rmarkdown_format()
>rmarkdown_template()
>render_page(pkg, "article", data)
I've pushed a branch on my fork here with one passing test (for index.md) and one failing test (for index.Rmd) to demonstrate.
Let me know if you'd like that in a PR. Unfortunately I won't have time in the near future to send a fix.
The text was updated successfully, but these errors were encountered: