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

goldingn opened this Issue Aug 24, 2018 · 3 comments


None yet
3 participants
Copy link

goldingn commented Aug 24, 2018

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:
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 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.


This comment has been minimized.

Copy link
Contributor Author

goldingn commented Oct 7, 2018

I've rebased that branch with the failing test onto the current master:

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.


This comment has been minimized.

Copy link

jayhesselberth commented Oct 7, 2018

I'm not sure what you're trying to do. Do you want to be able to render a Rmd file into a home page that does not have a sidebar? If so you could also use custom JS/CSS to hide the sidebar on the home page.


This comment has been minimized.

Copy link
Contributor Author

goldingn commented Oct 7, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment