Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 6731202

Browse files
authored
Merge pull request #136 from rgaiacs/styles-edit-on-github
Edit on GitHub
2 parents 89b2d3c + 15da8bb commit 6731202

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

_includes/lesson_footer.html

+9-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ <h4>
1717
</div>
1818
<div class="col-md-6" align="right">
1919
<h4>
20-
<a href="{{ site.github.repository_url }}/">Source</a>
20+
{% if page.source %}
21+
{% if page.source == "Rmd" %}
22+
<a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Edit on GitHub</a>
23+
{% endif %}
24+
{% else %}
25+
<a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path}}">Edit on GitHub</a>
26+
{% endif %}
2127
/
2228
<a href="{{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a>
2329
/
30+
<a href="{{ site.github.repository_url }}/">Source</a>
31+
/
2432
<a href="{{ site.github.repository_url }}/blob/gh-pages/CITATION">Cite</a>
2533
/
2634
<a href="{{ site.contact }}">Contact</a>

_includes/navbar.html

+8-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
{% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
5252
{% if site.kind == "lesson" %}
5353
<li><a href="{{ page.root }}/setup/">Setup</a></li>
54-
<li><a href="{{ page.root }}/reference/">Reference</a></li>
5554
<li class="dropdown">
5655
<a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a>
5756
<ul class="dropdown-menu">
@@ -67,6 +66,7 @@
6766
<li class="dropdown">
6867
<a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
6968
<ul class="dropdown-menu">
69+
<li><a href="{{ page.root }}/reference/">Reference</a></li>
7070
{% for extra in site.extras %}
7171
<li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
7272
{% endfor %}
@@ -76,6 +76,13 @@
7676

7777
{% comment %} Always show license. {% endcomment %}
7878
<li><a href="{{ page.root }}/license/">License</a></li>
79+
{% if page.source %}
80+
{% if page.source == "Rmd" %}
81+
<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>
82+
{% endif %}
83+
{% else %}
84+
<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>
85+
{% endif %}
7986
</ul>
8087
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
8188
<div class="form-group">

0 commit comments

Comments
 (0)