Jekyll doesn't export the _episodes_rmd so we need to flag the files.
Each Rmd file must have in the YAML header
source: Rmd
</div>
<div class="col-md-6" align="right">
<h4>
+ {% if page.source %}
+ {% if page.source == "Rmd" %}
+ <a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Edit on GitHub</a>
+ {% endif %}
+ {% else %}
<a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path}}">Edit on GitHub</a>
+ {% endif %}
/
<a href="{{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a>
/
{% comment %} Always show license. {% endcomment %}
<li><a href="{{ page.root }}/license/">License</a></li>
+ {% if page.source %}
+ {% if page.source == "Rmd" %}
+ <li><a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
+ {% endif %}
+ {% else %}
<li><a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
+ {% endif %}
</ul>
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
<div class="form-group">